Should you use cron or systemd timers on modern Linux?

By TechCompare · Updated · How we check

Use cron for simplicity, portability, and when you're on a non-systemd system. Use systemd timers when you need randomized delays, sub-minute precision, monotonic scheduling, or tight integration with systemd service management. Both are viable on modern Linux.

Cron has been the Unix job scheduler for 50 years. Systemd timers are the modern alternative, shipping by default on every major Linux distribution since roughly 2016. Choosing between them is a trade-off between simplicity and capability. Cron wins on portability and ease of use. Systemd timers win on precision and reliability features.

Schedule pattern
Cron vs systemd timers
cron-vs-systemd
Category
Comparisons
Cron vs alternative schedulers

How this is calculated

Systemd timers support features cron doesn't: randomized start delays (RandomizedDelaySec) to avoid thundering herds, monotonic timers such as OnUnitActiveSec that fire relative to the unit's last activation rather than wall clock time, sub-second precision, and proper dependency management between services. OnUnitInactiveSec is the separate option measured from the unit's last deactivation.

Cron's advantages are that it works on every Unix-like system including macOS, FreeBSD, and minimal containers, and its syntax is known by every sysadmin.

If you're scheduling on a single server and don't need the advanced features, cron is fine. If you're deploying to a fleet of Linux servers and need coordinated timing, randomized jitter, or sub-minute scheduling, systemd timers are the right choice.

Verdict

Pick cron when you need reach and simplicity, and pick timers when you need jitter and precision. systemd adds RandomizedDelaySec to dodge thundering herds, OnUnitActiveSec for monotonic timing relative to the unit's last activation, sub-second precision, and service dependency management. cron still runs on macOS, FreeBSD, and minimal containers where systemd isn't present.

More Cron scenarios

Every 5 minutes
Running a cron job every 5 minutes uses the step operator in the minute field: */5 * * * *.
View details
Every hour
To run a job at the top of every hour, use 0 * * * *.
View details
Daily at midnight
0 0 * * * runs a job at exactly midnight (00:00) every day.
View details

Frequently asked questions

What's the difference between cron and systemd timers?
Cron is a 5-field text syntax that's worked the same way for 50 years and runs on every Unix-like system, including macOS, FreeBSD, and minimal containers. systemd timers are unit files on modern Linux with features cron lacks: randomized start delays, monotonic timers relative to a unit's activation or deactivation, sub-second precision, and proper dependency ordering between services.
What can systemd timers do that cron can't?
Four things come up most. RandomizedDelaySec spreads fleet-wide jobs over a window so hundreds of servers don't hammer an API at the same minute. OnUnitActiveSec fires relative to the unit's last activation, while OnUnitInactiveSec measures from its last deactivation. Timers can catch up on missed runs after a boot. They also log to the journal with proper exit tracking instead of mailing output into the void.
Should I migrate my cron jobs to systemd timers?
Only if you're hitting cron's limits. If your jobs run on a single Linux server at simple wall-clock times, cron is fine and every sysadmin can read it. Migrate when you need randomized jitter across a fleet, sub-minute scheduling, catch-up-after-boot behavior, or tight coupling with systemd services. Many schedules translate directly, but cron treats restricted day-of-month and day-of-week fields as OR conditions while one systemd OnCalendar expression combines them as filters. Split that cron case into two OnCalendar expressions to preserve every run.