3 ms·
> better open source job scheduler [...] one that will ensure no overlapping runs Or learn to use lock files, which would make sure that your jobs don't run
by jcynix 1y ago
> better open source job scheduler [...] one that will ensure no overlapping runs
Or learn to use lock files, which would make sure that your jobs don't run when another one is already running?
Unix shells offer the trap command, among other things, to cleanup, even in the case of errors, e.g.:
set -e
LOCK=$(ensure-lock)
trap "rm $LOCK" 0 1 2 15
do-job
https://en.wikipedia.org/wiki/Semaphore_%28programming%29 https://en.wikipedia.org/wiki/Semaphore_%28programming%29
- TylerE 1y agoTell me how that goes after a server malfunction or power failure. Where is your trap god then?
- jcynix 1y agoThe topic was to prevent overlapping runs. In case of power failures etc all your server processes have this problem. That's why, for example, /var/run exists and files/directories are deleted from /var/run on reboot?