![]() |
Linux Tar Guru's
I got a question I have two HD's on my server I want to back my sites over to the other HD once a week. Is there away to tar zip the domains and all sub folders and files in the domain where it keeps its chmod and all permissions on all files and subfolders and it's files? If so can someone please show me the command. Say I want to backup my-domain-name.com with all it's permisiions. That way if I was to have a problem I could just untar the good copy and be back in biz.
|
Take a look at rsync.
|
Yeah rsync works good. One of my issues is I got alot of data to move between servers, and wondered if there was a way to tar up the domains that where rsync on the old server. Once all the data is moved over to the new server rsync will be setup on the new server like it is on the old.
|
This should do it:
Code:
tar zcfp domains.tgz <paths> Code:
-p |
Thanks I will give it a shot.
|
Quote:
|
Ok so say this is my tar file after it's been tared up.
domains.tar What will be the command line to untar it with the -p option. |
If you used the option "z" before (while packing), you have to use it again while unpacking because "z" means -- use gzip compression. In that case you should use extension .tgz resp. .tar.gz not .tar nex time.
Finally, you can use either Code:
tar xvf domains.tar Code:
tar xzvf domains.tgz |
all this linux talk is going to excite us all.. ;)
|
Yeah, but it is still far better to describe parameters represented by alphanumerical characters than places to click on. :)
|
$ man tar
for huge amounts use bzip2, better compression, a bit slower. something like: tar cvyf archive.tar.bz2 domain_dir/ to untar it tar xvyf archive.tar.bz2 flag v is verbose, you don't need that in script. |
Quote:
So If I use this option when I untar the way you show it. Will it keep the same permissions and such when I untar it on the new server. I just hate having to re chmod all the files and such on my scripts :) Because once I tar the domain I will use wget and want to untar it and have all the same permissions in such already in place. I use the same file structure and such on both servers. So long as the permissions are the same when I untar I should be fine once I update my mysql DB's. |
Quote:
Yeah the -p was throwing me off thats why I did not know the command to untar and save all the permissions. |
All times are GMT -7. The time now is 01:30 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123