Cron To Timer

Cron To Timer

Paste a system crontab line and the timer and service you plan to replace it with. Get a change-ticket report that says whether the schedule and the run account stay the same.

Before · cron

One line from /etc/crontab or /etc/cron.d, with the user field.

After · systemd

The whole .timer unit, including [Timer].

The whole .service unit, including [Service].

Ctrl + Enter compares

Paste the cron line and both unit files, then press Compare.

You get two answers, schedule and run account, and a Markdown report to paste into your change ticket.

What it does

Moving a job from /etc/crontab to a systemd timer changes two things quietly. The OnCalendar expression can drift from the cron fields, and a service without User= runs as root even if cron ran the job as someone else. This page expands both schedules over one UTC week, minute by minute, reports the first difference, compares the configured accounts, and writes it up as Markdown you can paste into the ticket for whoever approves the cutover.

Worked example: a weekday backup moves to systemd

/etc/cron.d/backup
0 3 * * 1-5 backup /usr/local/bin/backup
backup.timer
[Unit]
Description=Nightly backup

[Timer]
OnCalendar=Mon..Fri *-*-* 03:00:00 UTC

[Install]
WantedBy=timers.target
backup.service
[Service]
Type=oneshot
ExecStart=/usr/local/bin/backup

The schedule matches: five runs a week, Monday to Friday at 03:00 UTC. The account does not: the service has no User=, so it would run as root instead of backup. Add User=backup under [Service] and compare again; the account reads Unchanged.

How to use it

  1. Paste the crontab line, including its user field.
  2. Type the timer and service filenames and paste both files.
  3. Press Compare, check the two results, then press Copy report and paste it into the change ticket.

What it does not do

Questions

What is the OnCalendar equivalent of a cron line?

For 0 3 * * 1-5, it is Mon..Fri *-*-* 03:00:00. Paste both here and the report confirms they produce the same runs over a full week.

Why does my service run as root?

A system service with no User= runs as root. If cron ran the job as another account, add User= with that name. The report warns you when this applies.

Why does it assume UTC?

Cron lines carry no time zone, so the page treats both schedules as UTC. Add UTC to OnCalendar= to make that true on the timer side.

What does Unknown mean?

The page found something it does not compare safely, such as a named weekday in cron or an OnBootSec= trigger. It names the line instead of guessing.

Is my configuration sent anywhere?

No. The comparison runs in this page. Closing the tab clears it.

See it work

Same schedule, different account: the new service would run the backup as root.
Same schedule, different account: the new service would run the backup as root.
One extra cron run found: 03:45 on Monday, cron only.
One extra cron run found: 03:45 on Monday, cron only.
A boot trigger it will not guess at: schedule Unknown, account still compared.
A boot trigger it will not guess at: schedule Unknown, account still compared.

More pictures, and how Cron To Timer works