Monday, August 10, 2009

rsync --delete --delete-excluded

SkyHi @ Monday, August 10, 2009
[root@web20 home]# ls -tlrh
total 12K
drwx------ 4 derek derek 4.0K Aug 6 09:26 derek
drwxr-xr-x 2 root root 4.0K Aug 10 11:13 derek2
-rw-r--r-- 1 root root 0 Aug 10 11:21 file100
[root@web20 home]#


[root@web20 home]# pwd
/home1/home
[root@web20 home]# ls -tlrh
total 8.0K
drwx------ 4 root root 4.0K Aug 10 11:11 derek
drwxr-xr-x 2 root root 4.0K Aug 10 11:14 derek2
-rw-r--r-- 1 root root 0 Aug 10 11:21 file100


root@web20 home]# rsync -v -r -u -L --bwlimit=200 -delete --delete-excluded /home /home1 >> /tmp/.report

--del an alias for --delete-during
--delete delete files that don’t exist on sender
--delete-before receiver deletes before transfer (default)
--delete-during receiver deletes during xfer, not before
--delete-after receiver deletes after transfer, not before
--delete-excluded also delete excluded files on receiver

#from web10
#rsync -e ssh -avz --bwlimit=200 --delete root@web1.sample.com:/var/www/html /var/www >> web11.rsync.report