lckdo1
Run a program with a lock held
Usage
lckdo [options]
lockfile
program
[arguments]
Overview
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
-wF[0] -
If the lock is already held by another process, wait for it to complete instead of failing immediately.
- FC-W {sec}F[0]
-
The same as -w but wait not more than sec seconds.
- FC
-eF[0] -
Execute the program directly without forking and waiting (keeps an extra file descriptor open).
- FC-E {nnn}F[0]
-
Set the file descriptor number to keep open when exec()ing (implies -e).
- FC
-nF[0] -
Do not create the lock file if it does not exist.
- FC
-qF[0] -
Produce no output if lock is already held.
- FC
-sF[0] -
Lock in shared (read) mode.
- FC
-xF[0] -
Lock in exclusive (write) mode (default).
- FC
-tF[0] -
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.
Releases
10 releases since Debian 5.0 (Lenny); the text changed 5 times.
-E until Debian 13 (Trixie);
-W until Debian 13 (Trixie);
-e until Debian 13 (Trixie);
-n until Debian 13 (Trixie);
-q until Debian 13 (Trixie);
-s until Debian 13 (Trixie);
-t until Debian 13 (Trixie);
-w until Debian 13 (Trixie);
-x until Debian 13 (Trixie).