File Corruption

Wayne Davison wayned at samba.org
Mon Sep 12 18:36:16 GMT 2005


On Mon, Sep 12, 2005 at 09:36:27AM -0600, Kevin Stussman wrote:
> if rsync does do a checksum after the file has been transferred, but
> the original file has been changed during transfer, wouldn't the final
> checksum then fail?

No, as you suspected, the checksum is for the data that rsync read from
the source file (which it then duplicated on the receiving side).  All
rsync knows is that it duplicated the data that was read from the source
file.

It might be possible to add an extra stat() of the source file after
reading it and take some kind of action if the st_mtime or st_size
changed (such as triggering a resend).  It might be good to look into
this to see if it is worth the trouble or not, but even this would not
do anything to avoid sending a partially-written file that was not yet
complete (if the data remained unchanged while rsync was reading it).

..wayne..


More information about the rsync mailing list