Cron Triggers Jobs Without Queuing Them: Four Scheduling Myths and a Run Wrapper
A developer found that cron fires processes on schedule but does not queue them, check whether prior runs have finished, or retry failed or missed runs. Overlapping jobs can therefore run concurrently and write to the same files. The article proposes a standard-library Python wrapper that uses a non-blocking file lock to skip overlapping runs with exit code 75, enforces a deadline, and records each state change in a JSONL ledger. It also advises setting cron schedules explicitly in UTC to avoid timezone and DST surprises. The author argues that a completion record is more reliable than a process exit code or a cron schedule when verifying that work actually happened.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in