Syntax for using rsync options --exclude and --delete!

Leslie_Branch at Leslie_Branch at
Wed Nov 20 19:24:01 EST 2002

Hello All,

I was wondering if anyone has a viable syntax solution for using rsync with
the --exclude and --delete option.

I have been using the rsync process to backup certain files and filesystems
for ease of recovery in the event of unexpected downtime on the primary.  I
recently noticed that the process is not deleting files on the destination
host that were removed from the source at some point in time.  According to
the options summary you can use the --delete option to accomplish this
however, I have not been successful in getting this to work in my test
environment and need your help.

Current Syntax:
rsync -vaox --exclude ".snapshot" * [destination]
NOTE: Current directory is source.

I have tried the following scenarios in my test environment:
rsync -vaox --exclude ".snapshot" --delete * [destination]
rsync -vaox --delete --exclude ".snapshot" * [destination]
rsync -varox --exclude ".snapshot" --delete * [destination]
rsync -varox --delete  * [destination]
rsync -vaox --delete * [destination]

Please help!

Btw - I am using rsync version 2.3.1



More information about the rsync mailing list