Cron to systemd Timer Converter

Turn a cron line into a systemd OnCalendar= value plus .timer and .service files. Runs in your browser.

Runs on your deviceFreeNo sign-up
Runs in your browser
Loading tool…

Designed to run in your browser. See the privacy policy.

About Cron to systemd Timer Converter

This tool converts a cron schedule into a systemd timer. Paste a five-field cron expression such as 0 9 * * 1-5, or a shortcut like @daily, and it writes the matching OnCalendar= line plus a ready-to-use .timer file and .service file you can copy or download.

Moving a crontab entry to systemd gives you logging through journalctl, a clear record of the last and next run, and the option to catch up on runs that were missed while the machine was switched off. The conversion runs in your browser, and it also shows the schedule in plain English so you can check it means what you think.

How to use

  1. Type or paste your cron schedule, for example */15 * * * * or @hourly.
  2. Enter a unit name (letters, digits, dashes) and the command the job should run.
  3. Choose whether the timer should be Persistent, so a run missed during downtime happens at the next boot.
  4. Download the .timer and .service files and place them in /etc/systemd/system/.
  5. Run systemctl daemon-reload, then systemctl enable --now <name>.timer to start the schedule.
  6. Optionally check the schedule on your server with systemd-analyze calendar '<OnCalendar value>'.

FAQ

How do I convert a cron job to a systemd timer?+
You need two units: a .service file that runs the command and a .timer file whose OnCalendar= line describes when. This tool builds both from your cron line. Install them in /etc/systemd/system/, reload systemd and enable the timer instead of keeping the crontab entry.
What is the OnCalendar equivalent of a cron expression?+
OnCalendar uses the form "weekday year-month-day hour:minute:second". For example, cron */15 * * * * becomes *-*-* *:00/15:00 and 0 9 * * 1-5 becomes Mon..Fri *-*-* 09:00:00. Shortcuts such as @daily and @hourly map to systemd's daily and hourly.
Why does my schedule produce two OnCalendar lines?+
When a cron line restricts both the day of the month and the weekday, cron runs the job if either one matches. A single OnCalendar expression requires both to match, so the tool writes one line for the weekdays and one for the days of the month. A timer may list several OnCalendar= lines.
What does Persistent=true do?+
With Persistent=true, systemd remembers when the timer last fired. If the machine was off at a scheduled time, the job runs once soon after the next boot. Cron has no built-in equivalent, which is a common reason to switch.
Can I convert @reboot to a systemd timer?+
@reboot is not a calendar time, so there is no OnCalendar value for it. Use OnBootSec= in the [Timer] section instead, for example OnBootSec=1min, or simply enable the service itself with WantedBy=multi-user.target.
Why is my command wrapped in /bin/sh -c?+
ExecStart= does not run your command through a shell, so pipes, redirects, && and variables would not work. If the command contains shell syntax, the tool wraps it in /bin/sh -c so it behaves the way it did in your crontab.