Cron ↔ Systemd Timer
Convert between crontab expressions and systemd OnCalendar timer format. Bidirectional with semantic difference warnings.
Common Schedules
Cron vs Systemd Timers
Cron has been the standard Unix job scheduler since the 1970s, using a compact 5-field syntax (minute, hour, day-of-month, month, day-of-week). Systemd timers are the modern replacement, offering features like boot-relative scheduling, randomized delays, and persistent timers that catch up on missed runs.
Key Differences
| Feature | Cron | Systemd Timer |
|---|---|---|
| DOM + DOW | OR (either triggers) | AND (both must match) |
| Seconds | Not supported | Supported (HH:MM:SS) |
| Year | Not supported | Supported (YYYY-MM-DD) |
| @reboot | Supported | Use OnBootSec=0 |
| Missed runs | Skipped | Persistent=true catches up |
| Random delay | Not native | RandomizedDelaySec= |
Cron Expression Format
A standard cron expression has 5 fields: minute hour day-of-month month day-of-week. Each field can contain a single value, a range (1-5), a list (1,3,5), a step (*/5), or a wildcard (*). Special strings like @daily and @hourly are also supported.
Systemd OnCalendar Format
Systemd uses OnCalendar= in .timer unit files. The format is DOW YYYY-MM-DD HH:MM:SS where each part supports wildcards (*), ranges (Mon..Fri), and steps (*/5). Shorthands like daily, hourly, and weekly are also valid.