multiple sessions to same destination

Wayne Davison wayned at
Thu Oct 10 22:55:59 EST 2002

On Thu, Oct 10, 2002 at 04:50:33PM -0400, Bennett Todd wrote:
> The rsync opens the target file to read; if some other rsync moves a
> new file into place before that, there's no concurrency, this is
> pure sequential rsyncs; if it moves the target file into place after
> it's been opened, the older copy of the target will still be used by
> the process we're looking at, through the open file handle it holds;
> the intruding copy won't have any effect.

Unfortunately it's a little more complicated than that.  There are two
processes opening the file, first the generator (that sends the check-
sums over to the sender) and then the receiver (that opens the file to
read matching checksum blocks from the local file).  It is possible for
the file to change between these two separate file opens, resulting in
the creation of a corrupt *temporary* file.  Fortunately for us, the
whole-file checksum won't match, so rsync won't move the resulting
corrupted file into place.  It will instead reset its checksum size and
try sending the file again.  If it fails again, it prints an error and
does not update the file.

Derek:  I'd recommend checking out "unison":

I use this software to keep my rc files in sync between several
machines, and it does a wonderful job of merging file changes in both


More information about the rsync mailing list