withlock/withlock-README.SuSE
Ismail Dönmez e17cacdc00 Accepting request 131512 from home:lrupp
The openSUSE admins make heavy use of this tool since years now. 
So I think it's time to include it officially in the next release of openSUSE and Base:System should be the devel project.

OBS-URL: https://build.opensuse.org/request/show/131512
OBS-URL: https://build.opensuse.org/package/show/Base:System/withlock?expand=0&rev=1
2012-08-24 19:49:33 +00:00

24 lines
768 B
Plaintext

= About =
withlock is a locking wrapper script to make sure that some program isn't run
more than once. It is ideal to prevent periodic jobs spawned by cron from
stacking up.
The locks created are valid only while the wrapper is running, and thus will
never require a cleanup, as after a reboot. Thus, the wrapper is safe and easy
to use, and much better than implementing half-hearted locking within scripts.
= Usage =
Usage is simple. Instead of your command
CMD ARGS...
you simply use
withlock LOCKFILE CMD ARGS...
Run withlock --help to see more options.
Note: the lockfile LOCKFILE must not be placed in a publicly writable
directory, because that would allow a symlink attack. For that reason,
withlock disallows lockfiles in such locations.