lockfile-progs - command-line programs to safely lock and unlock files and mailboxes (via liblockfile).
mail-lock [ --retry ''retry-count''?
mail-touchlock [ --oneshot?
lockfile-create [ --retry ''retry-count''?
lockfile-touch [ --oneshot?
lockfile-progs provide a method to lock and unlock
mailboxes and files safely (via liblockfile).
mail-lock: lock the current user's mailbox.
mail-unlock: unlock the current user's mailbox.
mail-touchlock: touch the lock on the current user's
Each of the mail locking commands is applied to the file
lockfile-create: lock a given file.
lockfile-remove: remove the lock on a given file.
lockfile-touch: touch the lock on a given
Once a file is locked, the lock must be touched at least
once every five minutes, or it will be considered stale and
a subsequent attempt to lock the file will succeed. For both
of the locking commands (mail-touchlock and
lockfile-touch), the --oneshot argument causes the
program to touch the lock and exit immediately. Otherwise
the program will loop forever, touching the lock once every
minute until it is killed.
For both of the locking commands (mail-lock and
lockfile-create), the --retry argument specifies (as
an integer) the maximum number of times to retry locking the
file before giving up if attempts are failing. Each retry
will be delayed a little longer than the last (in 5 second
increments) until a maximum delay of one minute between
retries is reached. The default retry count is 9 which, if
all 9 attempts to lock the file fail, will give up after 180
seconds (3 minutes).
Locking a file during a lengthy process:
lockfile-create /some/file lockfile-touch /some/file
Successful program execution.
Some problem was encountered.
1998 - Written by Rob Browning