CFG-04 · Scheduling

Crontab → systemd timer converter

Paste a cron expression, get the equivalent .service + .timer pair — including the two-line trick systemd needs for cron's day-of-month/day-of-week "OR" behavior. Pairs with the Cron Expression Builder if you're starting from scratch.

Cron expression

minutehourdaymonthweekday

Invalid cron expression — expected 5 fields: minute hour day month weekday

job.service


  

job.timer


  

Verify any custom expression yourself with systemd-analyze calendar "…" before relying on it in production.

The one conversion rule that trips up every hand conversion

Cron's day-of-month and day-of-week fields are OR'd when both are restricted — 0 2 15 * 1 means "the 15th, OR any Monday," not "the 15th only if it's a Monday." systemd's single-line OnCalendar= syntax ANDs date and weekday together instead, so a naive one-line conversion silently changes the schedule's meaning. This tool emits two separate OnCalendar= lines when both fields are restricted — multiple lines in one [Timer] section fire independently and are unioned, which correctly reproduces cron's OR behavior.

Everything else maps cleanly

Minute, hour, and month fields convert directly — comma lists, ranges, and steps all have systemd equivalents, and this tool expands them to explicit value lists rather than trying to preserve step syntax exactly, which is slightly more verbose but removes any ambiguity about what actually gets scheduled.

Why does a simple cron expression sometimes produce two OnCalendar lines?

Only when both the day-of-month and day-of-week fields are restricted (neither is *) — cron treats that combination as OR, and systemd needs two separate OnCalendar= lines to reproduce OR rather than the AND a single line would apply. Most real-world schedules use only one of the two fields and get a single line.

Does the converted timer run at exactly the same times as the cron job did?

Yes, for any standard 5-field cron expression — every value is expanded and reproduced exactly. Non-standard extensions some cron implementations support (@reboot, seconds fields) aren't something this converter handles; those need to be set up separately since they aren't part of the schedule this tool decodes.

Do I still need /etc/crontab or a user crontab after switching?

No — remove the line from crontab -e (or /etc/cron.d/) once the systemd timer is enabled, or the job will run twice on the same schedule from two different schedulers.