Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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




Tell me how that goes after a server malfunction or power failure. Where is your trap god then?

The 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?



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: