[mdlug] rsync scenarios

Michael ORourke mrorourke at earthlink.net
Wed Mar 9 15:31:49 EST 2011


Lug Nuts,

I have a couple of scenarios that I was trying to figure out.

First scenario...
What happens if you execute multiple rsync processes against the same directory at about the same time.  Will it cause problems?

Suppose you have an automated process, that checks a directory on Srv-1/dir1, then fires off a rsync process to Srv-2/dir1, what happens if the first rsync doesn't finish before another rsync process is fired off?  Ideally, I would like to have it wait, then re-execute or throw an error (rsync in process or something).  Of course I could write a wrapper script that sets a lockfile when the rsync process starts, and clears it when it finishes.  So I could guarantee that only one rsync process is running at a given time.

Another scenario...  what if you have a process that is writing to a file on Srv-1, but hasn't completed yet when the first rsync process fires off?  Does that file get skipped, or does it get partially rsync'd?

Anyone know how rsync handles these 2 different scenarios?

Thanks,
Mike




More information about the mdlug mailing list