Hi, I have a situation where the files I'm backing up are written to every fifteen minutes or so. There's a good possibility that rsync will try to copy a file while it is being written into, and I'm wondering if there's any risk that the _source_ file will be damaged? I've seen similar posts about the target file, but my concern is the source. Additionally, would the writing program be blocked from writing to the file if rsync is reading the file? Thanks a lot. Mohammed _________________________________________________________________ The New Busy is not the old busy. Search, chat and e-mail from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3
On Thu, 2010-04-15 at 17:41 -0700, Mohammed AlQuraishi wrote:> I have a situation where the files I'm backing up are written to every > fifteen minutes or so. There's a good possibility that rsync will try > to copy a file while it is being written into, and I'm wondering if > there's any risk that the _source_ file will be damaged? I've seen > similar posts about the target file, but my concern is the source.I've never heard of a file being damaged by reading it.> Additionally, would the writing program be blocked from writing to the > file if rsync is reading the file?Not on unix-like systems. OTOH, I believe Windows enforces read/write locking, so rsync could not have the file open for reading at the same time as another process has it open for writing. -- Matt
On Fri 16 Apr 2010, Matt McCutchen wrote:> > Additionally, would the writing program be blocked from writing to the > > file if rsync is reading the file? > > Not on unix-like systems. OTOH, I believe Windows enforces read/write > locking, so rsync could not have the file open for reading at the same > time as another process has it open for writing.And more importantly perhaps in this context: while rsync is reading the file, the program trying to open the file to update will fail to do so, and it might not handle that situation correctly (perhaps even crash). On windows of course; as Matt says, this is not an issue on unix-like systems. Paul