Tuesday, March 30, 2010

Tar and Rsync and cp: keep permission ownership

SkyHi @ Tuesday, March 30, 2010
###Create archive###

#cd /var/www/html
#tar -pcvzf public_html.tar.gz public_html/

##extract archive
#tar -pxvzf publi_html.tar.gz

p
, --same-permissions, --preserve-permissions

Keep permissions of extracted files the same as the
originals.


--same-owner

When extracting, create files with the same ownership as
the originals.



###rsync###
rsync -e ssh -v -z -r -L -t -p -o -g --delete root@wb1.pp.com:/var/www/admin /var/www >> wb1.rsync.report
rsync -e ssh -v -z -r -L -t -p -o -g --delete root@wb1.pp.
com:/var/www/auth /var/www >> wb1.rsync.report
rsync -e ssh -avz --bwlimit=200 --delete root@wb1.pp.
com:/var/www/html /var/www >> wb1.rsync.report

###Copy###
#cp -p