--remove-sent-files to remove "synced" files

Matt McCutchen hashproduct at gmail.com
Fri Jun 16 20:39:51 GMT 2006


On Fri, 2006-06-16 at 14:44 -0400, Matthew Breedlove wrote:
> I was looking through the documentation on –remove-sent-files and it
> seems it will only remove files actually sent across the connection.
> Am I correct in assuming this and is there any patch/method for
> removing synced files from the source regardless of whether they were
> necessary to transfer over or not?

Yes, that's correct.  Perhaps someone should submit a feature request
for an option to remove all synced files.  That option would let me
write a "mv2" to complement my "cp2".

Possible workarounds:

* If you're using a single source directory with no sender filters, just
write a script to "rm -rf" it after a successful rsync transfer.

* If you're using a single source directory but you have sender filters,
you can rsync an empty directory onto the source with those filters
applying to the receiver.

* One way to remove all synced regular files from the source is
--ignore-times, but that wastes CPU time, disk I/O, _and_ network I/O.

Matt




More information about the rsync mailing list