Cron vs systemd timers: which scheduler should you use 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 (OnUnitActiveSec) that fire relative to the last completion rather than wall clock time, sub-second precision, and proper dependency management between services. 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

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.

More Cron scenarios

Frequently asked questions

What is a Cron Job?
A cron job is a scheduled task that runs automatically on a Unix-like operating system (like Linux or macOS) at specific intervals. It is heavily used by developers to run background tasks like database backups, cache clearing, or sending nightly emails.
What do the 5 parts of a cron expression mean?
From left to right, the 5 fields are: Minute (0-59), Hour (0-23), Day of the Month (1-31), Month (1-12), and Day of the Week (0-6, where 0 and 7 are Sunday).
What does the asterisk (*) mean in Cron?
The asterisk acts as a wildcard, meaning 'every'. For example, if the minute field is an asterisk, the task runs every single minute. If the month field is an asterisk, the task runs every single month.
How do I run a task every 5 minutes?
To run a task every 5 minutes, use the slash operator in the minute field like this: */5 * * * *. The */5 means 'every 5th minute'.