rsync --delete not working (no wildcards)

Fabian Cenedese Cenedese at indel.ch
Tue Jan 29 00:21:34 MST 2013


At 22:02 28.01.2013 +0000, Stewart Jeacocke wrote:
>Hi,
>
>I'm trying to copy some directories with rsync and would like to
>delete files from the destination if they no longer exist in the
>source.
>
>I'm using the following command:
>
>rsync -v --archive --hard-links --delete --force
>--filter=':/.rsync-filter' /opt/ /mnt/backup/opt/
>
>/opt does not contain any files
>the destination contains one file
>
>stewart at attobeast:/etc$ ls /mnt/backup/opt/
>test-file
>
>after running the rsync command I would expect test-file to have been
>deleted but it isn't. I'm sure I'm missing something obvious in the
>man page that explains this behaviour but I can't figure it out. Can
>anyone enlighten me?

I'd say you have to give the parent folder as source to detect
missing files:

rsync ... /opt /mnt/backup/

Note the missing backslash of /opt.

bye  Fabi



More information about the rsync mailing list