4 ms·
OpenBSD's crontab provides a `-s command` flag which does similar thing in principle: https://man.openbsd.org/crontab.5 https://man.openbsd.org/crontab.5 "-s
by 1500100900 5y ago
OpenBSD's crontab provides a `-s command` flag which does similar thing in principle:
https://man.openbsd.org/crontab.5 https://man.openbsd.org/crontab.5
"-s command
Only a single instance of command will be run concurrently. Additional instances of command will not be scheduled until the earlier one completes."
But I don't think it saves the state somewhere permanently, which isn't a big problem until cron's process dies for some reason.
- absc 5y agoIf you need to save state across executions, you should write a daemon instead.
- jbverschoor 5y agoThen "rm" should be a daemon too
- adrianmonk 5y agocron applies this very method of attempting to handle state by merely being a daemon, and it's not enough because cron can crash. The approach you're suggesting is what led to the problem you're proposing it as a solution for.