How to avoid loosing rsync temp/partial files

Matt McCutchen matt at mattmccutchen.net
Sun Dec 30 18:49:10 GMT 2007


On Sun, 2007-12-30 at 12:46 +0200, Shushu Inbar שושו ענבר wrote:
> My problem is that when I have proper permissions in the partial dir,
> but no permissions in the destination dir, it means that the rsync
> deletes the original files, and after failing to copy the files
> from /tmp to the destination - it deletes the files from there as
> well... 

Yes, the premature deletion of the source files ought to be fixed.  The
trouble is that the receiver is sending MSG_SUCCESS as soon as the data
transfer is complete, regardless of the result of the finish_transfer
call (which, among other things, moves the temporary file into place).
The receiver shouldn't send MSG_SUCCESS until after finish_transfer
succeeds.  If it fails, I'm not sure what message (if any) should be
sent to indicate that the file transfer failed but shouldn't be redone.

Matt



More information about the rsync mailing list