Bug 14394 - Add an option for --remove-source-files to remove files right away
Summary: Add an option for --remove-source-files to remove files right away
Status: RESOLVED WONTFIX
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 3.2.0
Hardware: All All
: P5 enhancement (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-26 16:29 UTC by gustavo panizzo
Modified: 2020-06-07 18:37 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gustavo panizzo 2020-05-26 16:29:57 UTC
Hello

I want to have an option to change the behavior of --remove-source-files to remove the file right after it was transfer instead of after the whole operation finished.

My use case is to move files between systems with bad connectivity and
low disk space, on the recv side the files are deleted soon after
receiving them making rsync to download them again if the last sync
operation didn't finish correctly.

I use rsync like a queue in this case, sort of


thank you so much for the wonderful rsync!
Comment 1 Wayne Davison 2020-06-07 18:37:18 UTC
Rsync needs to ensure that the receiver created the file before the sender removes it or you could have the file vanish when an error occurs (and exist on neither side).  The deletion delay is somewhat large due to how much data is pushed down the socket from the generator. You could try specifying the --whole-file (-W) option to speed it up, but this would mean that any updated files that exist on both sides would be resent in total with no matching-data computations. You could also try breaking up the copy operations into single directories (use -d instead of -r) so that rsync finishes up each (smaller) operation more rapidly.