David Liontooth
2012-Aug-18 09:47 UTC
How to remove files at source present on destination without transferring them
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>
Wayne Davison
2012-Aug-21 17:11 UTC
How to remove files at source present on destination without transferring them
On Sat, Aug 18, 2012 at 2:47 AM, David Liontooth <lionteeth at cogweb.net>wrote:> Does rsync provide a way to remove files at the source that are present on > the destination, without first transferring the files? >If the file that is already on the destination is identical to the one on the other server's source (including modified-time), then a normal copy (w/--remove-source-files) will notice they are identical and just remove the source file. If the times differ, you can use --checksum and it will just tweak the time instead of doing an all-matching-data transfer. If you want to avoid the checksum time, you could consider using --size-only, but only if you are sure that identically-named files of the same size are always the same. ..wayne.. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.samba.org/pipermail/rsync/attachments/20120821/6667f68e/attachment.html>
Reasonably Related Threads
- Overwriting symlinks on OSX
- Expressions in --exclude-from file
- samba linking Linux and OSX -- weird permissions
- Attended transfer: transferring a call as soon as the destination starts ringing
- How to delete a whole destination tree (inclusive the destination its-self) with rsync (daemon)?