Cron vs systemd timers: cron runs lines, timers run units
Same 03:30 job on both clocks: cron mails an unread local mailbox and skips missed runs; a timer logs to the journal and catches up with Persistent=true. One line versus two unit files.
Cron vs systemd timers is a logging argument first: one 03:30 backup, an unread local mailbox under cron, a journal entry under a timer.
Cron fails silently. A timer leaves a journal entry for every run.
Cron vs systemd timers: which one tells you it ran?
30 3 * * * /usr/local/bin/backup.sh[Timer]OnCalendar=*-*-* 03:30:00Persistent=truejournalctl -u cron -n 20 # cron's trailjournalctl -u backup.service -f # the timer's job, live# RandomizedDelaySec stops a thousand machines hammering one server
Cron mails its output and skips a 03:30 missed while the box was off. A timer is a unit with status, dependencies and logs.
What are the practical gaps?
Timers log to the journal, wait for network-online.target or mounts, and offer OnBootSec=15min. Cron's five fields are compact; OnCalendar is more expressive.
| cron | systemd timer | |
|---|---|---|
| Setup | one crontab line | two unit files |
| Logging | local mail, usually unread | journal, per unit |
| Missed run (machine off) | skipped | runs once with Persistent=true |
| Dependencies / ordering | none — DIY in script | full unit dependencies |
| Randomised delay | DIY with $RANDOM | RandomizedDelaySec= |
| Test/dry-run schedule | no | systemd-analyze calendar |
| Exists everywhere | yes — containers, BSDs, embedded | needs systemd (PID 1) |
| User jobs without root | crontab -e | systemd --user units |
My timer isn't triggering — what gives?
A dead-looking timer is usually its service failing instantly. Four causes:
- Names don't match.
foo.timerfiresfoo.service;systemctl cat foo.timershows the target. - Edited but not reloaded.
sudo systemctl daemon-reload && sudo systemctl restart foo.timer. - Wrong status command.
systemctl status foo.timeris always active — readlist-timers. - The service is crashing.
journalctl -u foo.service --since -1hshows what list-timers hides.
Run either job by hand
systemctl list-timers --all sudo systemctl start backup.service crontab -l env -i SHELL=/bin/sh PATH=/usr/bin:/bin sh -c '/usr/local/bin/backup.sh'
The env -i test uses cron's bare PATH; its two classics — bare PATH and unquoted % — surface immediately.
- tested on systemd (PID 1) · timers · cron · journalctl · systemd-analyze
- first published 2026-09-11, record refreshed 2026-10-04; silent-failure behaviours are the documented defaults of cron and systemd
- verify: journalctl -u cron -n 20 → your command's CRON entry · systemctl list-timers --all → last + next run