systemd OnCalendar syntax, with the cron equivalents
On this page
An OnCalendar expression has up to three parts, a weekday, a date and a time, written as Mon..Fri *-*-* 09:00:00. It sets when a systemd timer fires, the way five fields do for a crontab line. Most cron schedules translate directly, and systemd-analyze calendar shows when an expression will run before you rely on it.
What is the format of an OnCalendar expression?
DayOfWeek Year-Month-Day Hour:Minute:Second- The weekday is optional.
Mon,Mon,FriandMon..Friall work. - The date is
Year-Month-Day, and the time isHour:Minute:Second. Each part accepts*for every value, a list with commas, a range with..and a repeat with/. - Leave out the time and it means midnight; leave out the date and it means every day.
*:0/15is every 15 minutes, counting from minute 0 of every hour.
Because there is a seconds part, a timer can fire at a precise second. The cron monitor on this site accepts only OnCalendar lines whose runs are at least 60 seconds apart.
How do you convert a cron expression to OnCalendar?
| Cron | OnCalendar | Runs |
|---|---|---|
*/15 * * * * | *-*-* *:00/15:00 | Every 15 minutes |
0 * * * * | *-*-* *:00:00 or hourly | At the start of every hour |
0 2 * * * | *-*-* 02:00:00 | Every day at 02:00 |
0 9 * * 1-5 | Mon..Fri *-*-* 09:00:00 | At 09:00 on weekdays |
0 0 1,15 * * | *-*-01,15 00:00:00 | At midnight on the 1st and 15th |
30 2 * * 0 | Sun *-*-* 02:30:00 | At 02:30 every Sunday |
These are the forms the cron generator and dialect converter writes. Paste any five-field line into it to get the OnCalendar form and a note about anything that does not translate.
Which shortcuts does OnCalendar accept?
| Shortcut | Same as |
|---|---|
minutely | *-*-* *:*:00 |
hourly | *-*-* *:00:00 |
daily | *-*-* 00:00:00 |
weekly | Mon *-*-* 00:00:00 |
monthly | *-*-01 00:00:00 |
quarterly | *-01,04,07,10-01 00:00:00 |
semiannually | *-01,07-01 00:00:00 |
yearly | *-01-01 00:00:00 |
weekly is Monday, while cron's @weekly is Sunday, so a straight swap changes the day.
How do the weekday and the date combine?
Differently from cron. In a crontab line with both day fields set, a match on either one runs the job. In OnCalendar the weekday is a filter on top of the date, so both must match: Mon *-*-01..07 03:00:00 runs only on a Monday that falls in the first seven days, which is the first Monday of the month. Cron cannot say that in one line; see the cron syntax cheat sheet for its rule.
A tilde counts days from the end of the month. *-*~1 is the last day of every month, and Mon *-05~07/1 is the last Monday in May, a schedule that no single cron line can express.
How do you test an expression before you use it?
systemd-analyze calendar "Mon..Fri *-*-* 09:00:00"
systemd-analyze calendar --iterations=5 "*-*-01,15 00:00:00"The first command prints the expression in its normalized form and the next time it fires. --iterations prints several runs, which is the quickest way to check a schedule. You can also see the next runs on any cron line in the next run calculator.
What else belongs in the timer?
Persistent=trueruns a job that was missed while the machine was off, once, at the next start. Cron has no equivalent.RandomizedDelaySec=spreads start times over a window, which keeps a fleet from all starting at once.AccuracySec=allows systemd to delay a run to save wakeups. It defaults to one minute.- A trailing time zone, such as
daily UTC, fixes the zone. Without it the expression follows the machine's time zone; see cron time zones and daylight saving time.
To watch a timer, ping from the service it starts, as in the systemd timers guide, and read cron vs systemd timers to choose between the two.
Sources
- systemd.time(7) manual page , read 26 November 2026
Questions and answers
- Use OnCalendar=*:0/5. It fires at minutes 0, 5, 10 and so on of every hour. For a fixed gap after the last run rather than a clock time, use OnUnitActiveSec=5min instead.
- The same as *-*-* 00:00:00: every day at midnight in the machine's time zone. Add a time, such as *-*-* 02:00:00, to move it.
- systemd accepts a seconds part, such as *:*:0/30. A CronMissed check cannot be that frequent: the shortest interval it accepts is one minute.
- Only with Persistent=true in the timer. Without it, the run is skipped, as it is in cron.
How do I run a systemd timer every 5 minutes?
What does OnCalendar=daily mean?
Can systemd run something every 30 seconds?
Does OnCalendar run a job that was missed while the machine was off?
Create a check, add one curl to the job, and CronMissed alerts you when a ping is late or reports a failure.
Start monitoring