Question about deleting a file from the server via Rsync

Matt McCutchen hashproduct+rsync at gmail.com
Tue Nov 28 04:38:44 GMT 2006


On 11/27/06, Ben Anderson <ben at capecomputing.com> wrote:
>  I'm using cwrsync (with rsync 2.6.9) via ssh

Careful: when we say "rsync via ssh", we usually mean that the client
rsync invokes a second instance of rsync on the server as the ssh
remote command.  Your setup counts as talking directly to an rsync
daemon; rsync doesn't care that the connection goes through ssh port
forwarding.

>  I'm trying to delete C:\ba\myFile.ico from the server by using
> --delete-excluded and
> --exclude="/cygdrive/C/ba/myFile.ico".
>
>  Command to run: "c:\cwRsync\bin\rsync.exe"  -vvv -R -r --delete-excluded
> --exclude="/cygdrive/C/ba/myFile.ico"
> /cygdrive/C/ba/myFile.ico
> rsync://myUser@localhost:9119/modName/BensComputer/

The trouble is that the receiving rsync only deletes files from a
directory if the entire directory is part of the transfer.  So you
should specify /cygdrive/C/ba , not /cygdrive/C/ba/myFile.ico , as the
source.

Keep in mind that you must continue to specify the --exclude rule on
future runs if you don't want rsync to copy myFile.ico to the server
again.

Matt


More information about the rsync mailing list