Bug 8973 - --delete or similar (--delete-after / --delete-before) does not work if used after --rsh
--delete or similar (--delete-after / --delete-before) does not work if used ...
Product: rsync
Classification: Unclassified
Component: core
All All
: P5 normal
: ---
Assigned To: Wayne Davison
Rsync QA Contact
Depends on:
  Show dependency treegraph
Reported: 2012-06-03 08:00 UTC by atajsic
Modified: 2012-06-16 17:13 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description atajsic 2012-06-03 08:00:54 UTC
Testing Environments

rsync -avzie --delete --rsh="ssh -p 1234 -i /home/username/.ssh/user-rsync-key" rsync@example.com:/var/www/ /media/Files/Backups/rsync/www/

This will copy, and update files as expected, however will not delete the files on the local machine if they no longer exist on the remote.

However, by moving the --delete to after the --rsh command, local files are deleted as expected...

rsync -avzie --rsh="ssh -p 1234 -i /home/username/.ssh/user-rsync-key" --delete rsync@example.com:/var/www/ /media/Files/Backups/rsync/www/
Comment 1 Wayne Davison 2012-06-16 17:13:10 UTC
The -e option is an alias for --rsh, so your first command says your remote-shell command is "--delete", and it is then changed by the repeated --rsh option.  Drop the "e" from the "-avzie" list, and you'll be fine.