File Locking

Paul Slootman paul+rsync at
Mon Aug 18 15:15:24 GMT 2008

On Mon 18 Aug 2008, lists at wrote:
> >> The way I solved this problem for a data-mirroring system was to use a
> >> small wrapper script that ensures only one invocation of rsync is ever
> >> running at one time. This proved to be a robust solution for our situation.
> >> --Kyle
> Thanks for the idea but I sometimes need more than one copy to run at the same time so that won't work.  File locking is about the only option I can see.

If you need to run more than one rsync over the same tree at the same
time, you may need to rethink your tree layout and/or your approach to
whatever problem you're trying to fix.  Running two rsyncs sequentially
will usually be faster than two concurrent ones, as that might cause
disk thrashing (the heads are continually seeking to and from where the
respective rsync processes are working).

Paul Slootman

More information about the rsync mailing list