rsync with (f)locks

Wayne Davison wayned at
Sat Nov 23 15:39:56 MST 2013

On Sat, Nov 23, 2013 at 11:36 AM, Thomas Jordan <tomjordan766 at>wrote:

> My question is: can you also put a wrapper around rsync when using the
> inetd (or xinetd) daemon approach to running rsync, by adding a line for
> inetd

Yes, that would work fine for an inetd approach.  For a daemon approach,
you could use a type of pid-lock mechanism using the "pre-xfer exec" and
"post-xfer exec" scripts and the $RSYNC_PID env var.  The only thing that
is weird about that is that the RSYNC_PID value is the pid of the pre-xfer
exec proc, not the pid of the transfer proc.  If you want to build in
automatic lock busting, you'd need to store both the $RSYNC_PID and the
pre-xfer func's parent-pid inside the lock file so that it can check for a
running process using the parent pid (and the post-xfer script can remove
the lock based on the $RSYNC_PID match).

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the rsync mailing list