The output goes nowhere
cron mails stdout and stderr to MAILTO, or to the local user if it is unset. In a container there is often no MTA, so the failure is discarded.
The nightly job ran for a year and then stopped. Nothing alerted, because cron writes to local mail and the container has no mail transfer agent. The cause is usually one of five: no daemon, the wrong timezone, a DST gap, an overlap, or an exit code nobody read.
This page is free. It covers how to prove a schedule is actually running, the failures that make a job disappear, and the heartbeat that catches the next one.
cron mails stdout and stderr to MAILTO, or to the local user if it is unset. In a container there is often no MTA, so the failure is discarded.
Most alerting fires on a non-zero exit or an exception. A job that never starts produces neither. You need to alert on the absence of success.
Servers run UTC; the schedule was written in local time. A one-hour gap becomes a missed day, and a DST change becomes a double run.
A slow run overlaps the next one, a lock file blocks it, and the job looks scheduled while nothing completes.
| Command | What it tells you |
|---|---|
| systemctl status cron or systemctl status crond | Whether the daemon is running and when it last started. |
| pgrep -a cron | In a container, whether any scheduler process exists at all. |
| crontab -l; ls /etc/cron.d /etc/cron.daily | The entries that exist, including ones you did not add. |
| systemctl list-timers --all | Next and last run for every timer; n/a in LAST means it never ran. |
| journalctl -u cron --since '7 days ago' | grep -i <job> | Execution and errors, if the daemon logs there. |
| grep CRON /var/log/syslog | The same evidence on hosts that still write syslog. |
| date; timedatectl | Host timezone and clock; compare with what the schedule assumes. |
| stat /var/run/<job>.last | The last successful completion, if your job writes it. A timestamp is better than a log line. |
| docker exec <container> ps -ef | Whether the container actually runs a scheduler, rather than inheriting the entrypoint's shell. |
| # | Failure mode | What you see | What to do |
|---|---|---|---|
| 1 | No daemon in the container | crontab -l shows the entry; ps shows no cron; the job never runs. | Start cron in the entrypoint with output to stdout, or use a scheduler designed for containers. Add a heartbeat. |
| 2 | Timezone mismatch | The job runs at the wrong hour or on the wrong day; timedatectl says UTC while the schedule was written for local time. | Schedule in UTC and document it, or set CRON_TZ where the implementation supports it. Cloudflare Cron Triggers are UTC only. |
| 3 | DST gap or duplicate | One run missing in spring, two runs in autumn. | Per crontab(5), times in the missing hour never match and times that occur twice run twice. Avoid 01:00–03:00 local for critical jobs, or make the job idempotent with a date guard. |
| 4 | Overlap and stale locks | A lock file exists, no process owns it, and every later run exits immediately. | Use flock -n on a file descriptor (the kernel releases it on exit), a timeout around the job, and an alert when a run is skipped. |
| 5 | Silent failure and no output channel | Non-zero exit, MAILTO points at a mailbox nobody reads, and no metric changed. | Log to stdout or the journal, alert on the absence of a success heartbeat, and record duration and exit code. |
| 6 | An unescaped % in the command | The command is cut off at the first %: date +%F becomes date +. | Escape it (date +%F) or move the command into a script. This one is easy to miss in a copied crontab line. |
| Scheduler | Strength | Failure you must plan for |
|---|---|---|
| cron | Simple, local, everywhere. | No catch-up, mail-based output, no overlap control unless you add it. |
| systemd timer | Persistent=true runs a missed job once after downtime; RandomizedDelaySec spreads load; output in the journal. | A catch-up run at boot can collide with the next scheduled run; check the service's own locking. |
| Cloudflare Cron Trigger | No server to keep alive; runs the Worker's scheduled handler. | UTC only, five-field syntax, and timing is best-effort rather than exact. |
| Container scheduler | Supervised with the app, logs to stdout. | If it is not PID 1 or supervised, it dies with the shell and restarts nothing. |
Write a timestamp or increment a counter on every successful run. Alert when it is older than two intervals, not when a single run fails.
For a daily job, page at 04:00 if the 03:00 run has not reported. This catches the daemon that never started.
Track both. A job that now takes three times as long is the next overlap, even when it still exits zero.
Count lock failures separately from job failures. They have different fixes and different urgency.
Check the daemon first: a container can hold the file and run no scheduler. Then check the timezone and the log for the exact minute. An entry is configuration, not evidence.
Only if something supervises it and its output reaches your logs. Otherwise a crash or a restart silently removes the schedule, and the container still looks healthy.
Local time repeated an hour at the end of daylight saving. cron ran matching jobs twice; in spring, times in the missing hour never matched. Schedule in UTC or guard the run with a date.
No. A crashed process leaves the file behind and every later run exits. Use a kernel-held lock such as flock, add a timeout, and alert when a run is skipped.
The paid runbooks cover the change windows around this: production defaults, deploy rollbacks, and the checks that only fail on a real domain.
This page is free, no checkout. Paid runbooks are $9.99 each and covered by the 7-day refund policy at /runbooks/refund.