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!
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.