How to remove files at source present on destination without transferring them

David Liontooth lionteeth at cogweb.net
Sat Aug 18 03:47:22 MDT 2012


Does rsync provide a way to remove files at the source that are present 
on the destination, without first transferring the files?

I run the same task on several computers that copy the results to a 
server. Once the material is copied, it should be deleted at the source 
on all the machines.

Say A and B run the same task. A finishes first and copies the result to 
server C. When B finishes, the results are already present on C and B 
should just delete its results.

I thought I could use

    --remove-source-files   sender removes synchronized files (non-dir)
    --ignore-existing       skip updating files that exist on receiver

but in my tests, this only removes files after they have been 
synchronized from that machine.

In other words, in the scenario above when B issues

     rsync ~/job44 C:~/jobs/ -av --remove-source-files --ignore-existing

and all the job44 files are already present, these files (not the 
directory) should be removed on the source, but they are not.

 From the man page, it sounds like rsync has this functionality, but in 
practice it appears not to have it. Am I missing something or should I 
be using other flags?

Cheers,
Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/rsync/attachments/20120818/a27c7fb5/attachment.html>


More information about the rsync mailing list