> One method to create locks is to use 'mkdir' within an 'if'
> statement (something like):

Definitely - especially since this method also works over NFS mounts
(where a mkdir operation is still atomic).  Of course you also have
to be willing to lock an entire execution of rsync as opposed to just
the file it is working on at any given moment.

Something to keep in mind though with locking this way is having some
sort of monitor over the process to ensure that you don't accidentally
end up in a permanently locked state (generally due to a script
dieing or a failure for the script to properly clean up the lock
directory), since the OS isn't going to clean up that directory
automatically on process exit, as it would with actual file locks.

-- David

/-----------------------------------------------------------------------\
 \               David Bolen            \   E-mail: [EMAIL PROTECTED]  /
  |             FitLinxx, Inc.            \  Phone: (203) 708-5192    |
 /  860 Canal Street, Stamford, CT  06902   \  Fax: (203) 316-5150     \
\-----------------------------------------------------------------------/

Reply via email to