GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Linux Tar Guru's (https://gfy.com/showthread.php?t=324988)

PeekHoles 07-12-2004 11:05 AM

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.

Radik 07-12-2004 11:18 AM

Take a look at rsync.

PeekHoles 07-12-2004 11:23 AM

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.

vending_machine 07-12-2004 11:29 AM

This should do it:

Code:

tar zcfp domains.tgz <paths>
snip from tar manual:

Code:

    -p
    --preserve-permissions  Extract all protection information.


PeekHoles 07-12-2004 11:34 AM

Thanks I will give it a shot.

dgraf 07-12-2004 12:04 PM

Quote:

Originally posted by vending_machine
This should do it:

Code:

tar zcfp domains.tgz <paths>
snip from tar manual:

Code:

    -p
    --preserve-permissions  Extract all protection information.


Therefore here is no reason to use this directive while making the archive. The parameter has to be used while extracting. Tar backups the permissions by default but if you do unpack (without the p option) the permissions are stripped according to your umask setting.

PeekHoles 07-12-2004 12:31 PM

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.

dgraf 07-12-2004 12:43 PM

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
or

Code:

tar xzvf domains.tgz
depending on if you used the "z" while packing.

princess 07-12-2004 01:25 PM

all this linux talk is going to excite us all.. ;)

dgraf 07-12-2004 01:33 PM

Yeah, but it is still far better to describe parameters represented by alphanumerical characters than places to click on. :)

Serge Litehead 07-12-2004 01:34 PM

$ 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.

PeekHoles 07-12-2004 04:12 PM

Quote:

Originally posted by holograph
$ 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.



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.

PeekHoles 07-12-2004 04:14 PM

Quote:

Originally posted by vending_machine
This should do it:

Code:

tar zcfp domains.tgz <paths>
snip from tar manual:

Code:

    -p
    --preserve-permissions  Extract all protection information.



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