Embed this tool on your site
<iframe src="https://devtoolbox.dedyn.io/tools/systemd-timer-generator" width="100%" height="920" frameborder="0" title="Systemd Timer Generator"></iframe>

Systemd Timer Generator

Generate a production-ready .timer + .service pair to replace cron jobs. Convert cron schedules to OnCalendar, or use interval timers (OnBootSec / OnUnitActiveSec). Everything runs in your browser.

Basics

Generates <name>.timer and <name>.service.
Used in the [Unit] section.
Use OnCalendar for “daily at 2am”. Use interval for “every 5 minutes”.
Defaults to <name>.service.

[Timer] OnCalendar schedule

Examples: daily, hourly, Mon..Fri 02:00:00, *:0/15 (every 15 min).
Paste a 5-field cron expression. We’ll generate one or more OnCalendar= lines.

Timer options

If the machine was off, systemd triggers the timer at boot to catch up.
Add jitter to avoid thundering herd (e.g., 300 seconds).
Lower values are more precise but may wake the CPU more often.
If supported, allows waking from suspend for the timer.

[Service] What to run

For scripts, prefer an absolute path. For complex services, see the Systemd Unit Generator.
Avoid running as root when possible.
Sets the working directory for the command.
Each line becomes an Environment= directive.

Generated unit files

example.timer

            
example.service

            

Install & test

Save the files to /etc/systemd/system/, then:

sudo systemctl daemon-reload
sudo systemctl enable --now example.timer
systemctl list-timers --all | grep -i example

# Test your schedule:
systemd-analyze calendar "daily"

View logs with journalctl -u <name>.service. (You enable the timer, not the service.)

Frequently Asked Questions

When should I use OnCalendar vs interval timers?

Use OnCalendar for wall-clock schedules like “every day at 02:00” or “Mondays at 9am”. Use interval timers (OnBootSec, OnUnitActiveSec) for “every N minutes” style jobs when you don’t care about the exact wall clock.

Why do people prefer systemd timers over cron?

Systemd timers integrate with the service manager: dependency ordering, centralized logs (journalctl), per-unit resource limits, and features like Persistent=true (catch up on missed runs) and RandomizedDelaySec (jitter).

How do I validate my unit files?

You can validate syntax with systemd-analyze verify /etc/systemd/system/<name>.timer and check when the timer will trigger with systemd-analyze calendar. Then inspect runtime status with systemctl status.

Can I convert any cron schedule to OnCalendar?

Most common cron schedules convert cleanly. Some advanced expressions (like complex ranges/steps) may need manual tweaks or multiple OnCalendar= lines. Always verify with systemd-analyze calendar.

Related Tools & Guides

Systemd Unit Generator Crontab Builder Cron Parser Systemd: The Complete Guide