Exclude option not working

Matt McCutchen hashproduct+rsync at gmail.com
Mon Jun 4 13:48:55 GMT 2007


On 6/4/07, Madhavan Chari <madhavanchari at 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>&1

It 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


More information about the rsync mailing list