LCKDO(1) moreutils LCKDO(1)

.SH "NAME" lckdo - run a program with a lock held

.SH "SYNOPSIS"

.HP 144u

**lckdo** \[options] {lockfile} {program} \[arguments]

.SH "DESCRIPTION"

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

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

.SH "OPTIONS"

.PP **-w**

If the lock is already held by another process, wait for it to complete instead of failing immediately.

.RE .PP **-W {sec}**

The same as -w but wait not more than sec seconds.

.RE

.PP **-e**

Execute the program directly without forking and waiting (keeps an extra file descriptor open).

.RE

.PP **-E {nnn}**

Set the file descriptor number to keep open when exec()ing (implies -e).

.RE

.PP **-n**

Do not create the lock file if it does not exist.

.RE

.PP **-q**

Produce no output if lock is already held.

.RE

.PP **-s**

Lock in shared (read) mode.

.RE

.PP **-x**

Lock in exclusive (write) mode (default).

.RE

.PP **-t**

Test for lock existence.

.RE

.SH "EXIT STATUS"

.PP 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.

.SH "AUTHOR"

.PP Michael Tokarev

2007-08-15 moreutils

---

Document: lckdo(1) from moreutils 0.70-r1 (Chainguard OS)
Source: git://git.joeyh.name/moreutils
