multiple sessions to same destination
dereks at itsite.com
Thu Oct 10 20:08:00 EST 2002
> Yeah, you're fine, as long as, as you say, no two sessions are accessing
> the same objects. Even then, rsync handles it fairly well...
Can you elaborate on this?
Below is message I sent a while ago, but never got a response on.
I'd like to know what you mean by "rsync handles it fairly well". Any
information you have would be greatly appreciated.
Date: Thu, 26 Sep 2002 17:24:53 -0700 (PDT)
Subject: Server writes...?
I have a quick question about rsync's writing of files.
I have a team of people that all use the host BigServer, which is
running rsync as a deamon, as a central place to keep all shared files
backed up. The "master copy" for any given file is considered to be the
local file that somebody has worked on -- i.e., BigServer is NOT
considered the master copy. BigServer is the backup copy. Team members
back up their files to BigServer periodically with the rsync client.
Sometimes several team members work on the same file. In this
case, the team member who most recently rsync'd their local copy up to
BigServer has a backup -- anyone else loses their "BigServer backup copy"
the instant one of the other team members uploads their version. (The
semantics are exactly like a team sharing a single Samba share for
The files the team write might be big, as in several dozen or
hundreds of megs.
Now to my question: What happens if three team members all try to
write the same huge file to BigServer at "the same time"? Meaning, the
rsync daemon on BigServer gets three connections that start uploading
"/shared_space/bigfile.mov", before any one of the connections has
finished uploading its complete copy?
Is there any chance that the resulting "/shared_space/bigfile.mov"
on BigServer would have a corrupted copy, because several clients were
uploading at the same time? Or, does the rsync daemon guarantee that the
last person (the 3rd team member to connect to BigServer) gets to upload
the final, uncorrupted version of "bigfile.mov" to BigServer?
Any help is greatly appreciated. I've read all the docs I could
find but did not see this addressed.
dereks at itsite dot com
Since that email I have learned that rsync uploads to a temporary
file, and then copies or moves it over to the final destination. (See the
--temp-dir option to rsync). So I think the problem is reduced to the
question as "what if 3 logged in users cp (or mv?) a file to the same
destination at the same time". But I'm not sure.
Any information is greatly appreciated.
More information about the rsync