rsync with (f)locks

Thomas Jordan tomjordan766 at
Sun Nov 24 03:10:19 MST 2013

On 23/11/2013 10:39 PM, Wayne Davison wrote:
> On Sat, Nov 23, 2013 at 11:36 AM, Thomas Jordan 
> <tomjordan766 at <mailto: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).
> ..wayne..
Thanks, Wayne, I hadn't picked up on the pre-xfer exec and post-xfer 
exec options.

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

More information about the rsync mailing list