Leslie_Branch@hgsi.com
2002-Nov-20 19:24 UTC
Syntax for using rsync options --exclude and --delete!
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 THANKS IN ADVANCE FOR YOUR HELP! Leslie
Leslie_Branch@hgsi.com <Leslie_Branch@hgsi.com> wrote:> I was wondering if anyone has a viable syntax solution for using > rsync with the --exclude and --delete option....> Current Syntax: > rsync -vaox --exclude ".snapshot" * [destination] > NOTE: Current directory is source.I believe changing * to . will solve your problem. I think delete disables itself when rsync is given more than 1 source. (i.e. * expands to multiple objects, whereas . is a single source)> Btw - I am using rsync version 2.3.1That's ancient - Upgrade! Max.
On Wed, Nov 20, 2002 at 02:19:20PM -0500, Leslie_Branch@hgsi.com wrote:> 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 > > THANKS IN ADVANCE FOR YOUR HELP! > > LeslieThe * is expanded by the shell. It doesn't include dot files therefore rsync won't even see them. Use . if you wish to syncronize the current directory. Also see --delete-excluded -- ________________________________________________________________ J.W. Schultz Pegasystems Technologies email address: jw@pegasys.ws Remember Cernan and Schmitt