Deleted remote directories not being removed locally
david at auto123.com
Fri Dec 2 20:21:13 GMT 2005
Wayne Davison wrote:
>On Fri, Dec 02, 2005 at 10:00:14AM -0500, David Filion wrote:
>>rsync -v --stats -d --include='+ */' --include='- *' --force
>>--delete-during --backup \
>>--backup-dir=/mnt/backups/_DELETED 192.168.0.2::'ucp/*' .
>Read the first two paragraphs from the --delete option in the rsync
>It explains why the '*' is not appropriate and also that -r is
>(currently) required to be used (the CVS version will delete inside
>directories sent via -d, but not older versions of rsync). If you
>don't want subdirectories inside the top-level dirs to be copied,
>you can either exclude them (add --exclude='*/*' prior to your first
>include and add -r to the options) or upgrade to the CVS version.
After some reading and keyboard bashing, I thought I made some headway.
I now use:
rsync -r --delete --delete-during --backup --backup-dir=$DELETEDIR \
-v --stats -d --force --include='+ */' --include='- *' $SERVER::'ucp/' .
to fetch the list of directories into the current directory. The
are created correctly. However, when I remove a directory on the source
the local version is (still) not (re)moved. I can confirm that the
contains files. The kicker is, if I dry-run the command it prints:
receiving file list ... done
Why does the dry-run indicate the directory is deleted, but when run with
out the dry-run flag, it is not?
More information about the rsync