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

Matthew Breedlove mbreedlove at unitrends.com
Fri Jun 16 20:48:25 GMT 2006


I appreciate the response.  What I was trying to do was setup rsync in a
position so that if a network failure came about I can easily kick off
the same rsync command to have it essentially pick-up where it left off.
Having --remove-sent-files is definitely an improvement but if it fails
it will still have to do checks against files that it didn't need to
sync over.  If I am trying to sync over a large amount of files (10k+)
over a longer period of time it would eliminate a lot of overhead needed
to complete the sync.  


Matt Breedlove

-----Original Message-----
From: Matt McCutchen [mailto:hashproduct at gmail.com] 
Sent: Friday, June 16, 2006 4:40 PM
To: Matthew Breedlove
Cc: rsync at lists.samba.org
Subject: Re: --remove-sent-files to remove "synced" files

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.


More information about the rsync mailing list