Cron vs systemd timers
On this page
Use cron when you want one line and a portable file; use a systemd timer when you want logs in the journal, catch-up after downtime, resource limits and dependencies. Both can be monitored the same way: with a ping from the job.
How do they compare?
| Question | cron | systemd timer |
|---|---|---|
| Where is the schedule? | One crontab line | A .timer unit and a .service unit |
| Schedule syntax | Five fields; names for months and days | OnCalendar expressions with seconds, or monotonic timers |
| Missed run while the machine was off | Skipped | Caught up with Persistent=true on OnCalendar timers |
| Accuracy | To the minute | Within AccuracySec, one minute by default |
| Random spread of start times | Not built in | RandomizedDelaySec |
| Output and logs | Mail or your own redirect | The journal, per unit |
| Failure state | None kept | The unit shows failed with its exit status |
| Environment | Minimal: SHELL, LOGNAME, HOME | Clean; set Environment= or EnvironmentFile= |
When does each win?
- Cron: quick jobs on any Unix machine, portable crontabs, hosts where you do not control systemd.
- systemd timers: jobs that must catch up after downtime, services that need sandboxing or limits, and anywhere you want
systemctl statusto tell you the last result.
How do I monitor each?
For cron, append a curl to the line, as in the crontab guide. For a timer, use ExecStartPre and ExecStopPost in the service so that the start and the exit status are reported, as in the systemd guide. A cron check can follow either one, because the check cares about when pings arrive, not about the scheduler behind them.
Sources
- systemd.timer manual page , read 22 October 2026
- crontab(5) manual page , read 22 October 2026
Questions and answers
- Mostly. The dialect converter writes the OnCalendar form of a cron schedule and flags anything that does not translate.
- It improves the evidence after the fact. It does not tell you when a timer is disabled, the machine is off, or the unit was never started. A heartbeat does.
Can I convert a crontab line to OnCalendar?
Does a timer replace the need for monitoring?
Know the moment a job goes quiet
Create a check, add one curl to the job, and CronMissed alerts you when a ping is late or reports a failure.
Start monitoring