TechCompare LogoTechCompare

Cron vs systemd timers: which scheduler should you use on modern Linux?

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. The decision is about your specific operational requirements.

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.

By TechCompare · Updated

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

The split comes down to features versus ubiquity. 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. Pick cron when you need that reach, and pick timers when you need the jitter and precision.

More Cron scenarios

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.