Hi , Hope you are doing good. I am Madhavan from India . I was trying to implement the wonderful rsync concept in my project for file mirroring. I implemented the functunality but the only problem I am facing is in the * exclude* directory option. Though I am trying to exclude the directory by giving proper syntex for exclude but I find once the whole rsync is completed the directory still gets copied in target location. Here is what I am tryng to do: rsync -az -t -e ssh -vv --delete --delete-excluded opt/mscdr/arb821/Server/logs --delete-excluded opt/mscdr/arb821/Server/altavistaDir --exclude --bwlimit=1000 $HOSTTOBACKUP:$SOURCE $DR_BACKUP_DIR/daily.0 >$tempfile 2>&1 Here the logs and altavistaDir is getting copied which must be excluded as per the reference material I refered from the internet. rsync.samba.org/ftp/rsync/rsync.html I would appreciate your help in this regards as I dont have any other refernce to get the exact cause for the problem. Regards, Madhavan Chari -------------- next part -------------- HTML attachment scrubbed and removed
On 6/4/07, Madhavan Chari <madhavanchari@gmail.com> wrote:> Though I am trying to exclude the directory by giving proper syntex for > exclude but I find once the whole > rsync is completed the directory still gets copied in target location.> rsync -az -t -e ssh -vv --delete --delete-excluded > opt/mscdr/arb821/Server/logs --delete-excluded > opt/mscdr/arb821/Server/altavistaDir --exclude > --bwlimit=1000 $HOSTTOBACKUP:$SOURCE $DR_BACKUP_DIR/daily.0 >$tempfile 2>&1It looks like you have --exclude and --delete-excluded backwards. Each --exclude specifies an exclude filter (which could be just a directory), while --delete-excluded is a single flag that stops exclude filters from protecting destination files from deletion. Try this command: rsync -az -t -e ssh -vv --delete --exclude opt/mscdr/arb821/Server/logs --exclude opt/mscdr/arb821/Server/altavistaDir --delete-excluded --bwlimit=1000 $HOSTTOBACKUP:$SOURCE $DR_BACKUP_DIR/daily.0 >$tempfile 2>&1 Matt