Convert cron to systemd timer
This page shows how to write a standard five-field Unix cron schedule as a systemd timer schedule. Every example below is produced by the CronLabs engine. To convert an expression of your own, open the interactive converter.
Example conversions
Each row shows a common cron expression, what it does, and the equivalent systemd timer schedule.
| Cron | Meaning | systemd timer |
|---|---|---|
| 0 9 * * * | at 9:00 AM | *-*-* 09:00:00 |
| */15 * * * * | every 15 minutes | *-*-* *:0/15:00 |
| 0 9 * * 1-5 | at 9:00 AM on weekdays | Mon..Fri *-*-* 09:00:00 |
| 0 0 * * 0 | Every Sunday at midnight | Sun *-*-* 00:00:00 |
| 0 0 1 * * | First day of every month at midnight | *-*-01 00:00:00 |
| 30 2 * * * | at minute 30 at 2:30 AM | *-*-* 02:30:00 |
Ready-to-use systemd timer configuration
The snippet below schedules a job for at 9:00 AM on weekdays (cron 0 9 * * 1-5). Replace the placeholder command and names with your own values.
systemd timer · ini
# /etc/systemd/system/my-job.timer
[Unit]
Description=my-job
[Timer]
OnCalendar=Mon..Fri *-*-* 09:00:00
Persistent=true
[Install]
WantedBy=timers.targetThings to know about systemd timer schedules
systemd uses OnCalendar (DayOfWeek Year-Month-Day Hour:Minute:Second), a different grammar from cron.
This expression uses lists/ranges that don't map 1:1 to OnCalendar. Verify with: systemd-analyze calendar '<value>'.
For the full syntax, see the official systemd timer documentation.
Convert your own expression
Paste any cron expression into the validator to see its next run times, a calendar view, and the equivalent schedule for every supported platform.
Open the validator