lckdo(1)

NAME
lckdo - run a program with a lock held

SYNOPSIS
lckdo
[options] {lockfile} {program} [arguments]

DESCRIPTION
lckdo runs a program with a lock held, in order to prevent multiple processes from running in parallel. Use just like nice or nohup.

Now that util-linux contains a similar command named flock, lckdo is deprecated, and will be removed from some future version of moreutils.

OPTIONS

\FC-w\F[]
    If the lock is already held by another process, wait for it to complete instead of failing immediately.

\FC-W {sec}\F[]
    The same as -w but wait not more than sec seconds.

\FC-e\F[]
    Execute the program directly without forking and waiting (keeps an extra file descriptor open).

\FC-E {nnn}\F[]
    Set the file descriptor number to keep open when exec()ing (implies -e).

\FC-n\F[]
    Do not create the lock file if it does not exist.

\FC-q\F[]
    Produce no output if lock is already held.

\FC-s\F[]
    Lock in shared (read) mode.

\FC-x\F[]
    Lock in exclusive (write) mode (default).

\FC-t\F[]
    Test for lock existence.

EXIT STATUS
If the lock was successfully acquired, the return value is that of the program invoked by lckdo. If the lock couldn't be acquired, EX_TEMPFAIL is returned. If there was a problem opening/creating or locking the lock file, EX_CANTCREAT or EX_OSERR will be returned.

AUTHOR
Michael Tokarev