Skip to main content

rawops.dev

Skip to tool content

Cron ↔ Systemd Timer

Convert between crontab expressions and systemd OnCalendar timer format. Bidirectional with semantic difference warnings.

Click to swap direction
*-*-* 00:00:00
Converted from cron: 0 0 * * *

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

FeatureCronSystemd Timer
DOM + DOWOR (either triggers)AND (both must match)
SecondsNot supportedSupported (HH:MM:SS)
YearNot supportedSupported (YYYY-MM-DD)
@rebootSupportedUse OnBootSec=0
Missed runsSkippedPersistent=true catches up
Random delayNot nativeRandomizedDelaySec=

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.

Related Tools & Resources