Sooner or later every Linux machine needs something to happen on a schedule: a backup at night, a report in the morning, a cleanup every quarter of an hour. Two tools do that job. Cron is the old one, a single line of five fields in a crontab file. Systemd timers are the newer one, built into the init system most distributions now ship. They overlap a lot, differ in a few ways that matter, and picking between them is a question of what your job needs and where it runs.

This guide compares the two fairly and shows how to verify the cron side of any decision with the free Cron Expression Builder on Ovatly, which explains expressions in plain English and lists their next run times.

Contents

  • Quick answer
  • How each scheduler is written
  • Portability and availability
  • Logging, dependencies and missed runs
  • How to check the cron side, step by step
  • Worked example: one schedule, both spellings
  • Limitations and honest notes
  • Common mistakes
  • FAQs
  • Conclusion

Quick answer

Choose cron when the job is simple, the schedule is a regular pattern, and the same setup may need to run on different machines or hosting environments: cron is one line, it is everywhere, and its finest granularity is one minute. Choose a systemd timer when the machine already runs systemd and the job needs what cron leaves to you: output captured in the journal, ordering against other services, or a catch-up run after downtime. There is no universal winner, and plenty of systems sensibly use both. Either way, check cron expressions first in the Cron Expression Builder: paste one in, read the plain-English description, and confirm the next five run times match the schedule you meant.

How each scheduler is written

A cron job is a line in a crontab with five time fields followed by the command:

0 9 * * 1-5  /usr/local/bin/send-report

The fields are minute (0-59), hour (0-23), day of month (1-31), month (1-12) and day of week (0-7, where both 0 and 7 mean Sunday). That line reads as 09:00, Monday to Friday. Editing a schedule means editing that one line, usually with crontab -e.

A systemd timer is two files. A .service unit describes the work, and a .timer unit describes when it runs, using calendar expressions such as OnCalendar=Mon..Fri 09:00 or interval directives such as OnUnitActiveSec=15min. The timer is then enabled with systemctl enable --now send-report.timer. That is more ceremony than a crontab line, but the structured files give descriptions, dependencies and conditions named places to go.

Portability and availability

Cron's strongest card is reach. Some implementation of cron exists on essentially every Unix-like system: Linux servers, BSD machines, macOS, shared hosting, containers with a cron package added. A crontab you write today will be understood, unchanged, on a machine you have never seen. If a schedule has to travel, cron is the spelling that survives the trip.

Systemd timers only exist where systemd is the init system. That covers most mainstream Linux distributions, but it excludes macOS, the BSDs, minimal containers without systemd, and hosts where you lack the privileges to install unit files. Timer units also bake paths, users and service names into the files, so moving one usually means editing, not just copying.

Logging, dependencies and missed runs

This is where systemd timers pull ahead. A timer starts a service, and service output goes to the journal, where journalctl shows what a job printed and whether it failed, alongside the rest of the system's logs. Cron discards output unless you redirect it yourself or configure mail; a failing cron job is famously silent until someone notices the missing result.

Dependencies are the second gap. A systemd unit can declare that it runs after the network is up or after a mount exists, and systemd enforces that ordering. Cron has no such concept: the job fires at the stated time and the command must cope with whatever state the machine is in.

Missed runs are the third. If a machine is off at 03:00, cron simply never fires the 03:00 job. A systemd timer with Persistent=true notices the missed trigger at the next boot and runs the job then, which is what you want for a daily backup on a laptop that sleeps.

Against all that, cron's failure modes are simple and well understood after decades of use. A timer unit that is written but never enabled, or whose service name does not match, fails quietly in its own way.

How to check the cron side, step by step

If any part of the plan is a cron expression, verify it before it goes anywhere near a crontab:

  1. Open the Cron Expression Builder and paste the expression into the lower field.
  2. Read the plain-English description it gives back, word by word, against the schedule you intended.
  3. Read the next five run times listed below it. They are shown in your local time zone, with real dates, so a wrong day-of-week shows up as a date you did not expect.
  4. If you are building from scratch instead, choose a pattern from the list, set the hour and minute, and read the generated expression and description the same way.

Worked example: one schedule, both spellings

Take the schedule "weekdays at 9 in the morning". As cron it is 0 9 * * 1-5. Pasting that into the builder returns the description "At 09:00, Monday to Friday", and run from a Friday, the next listed run is the following Monday at 09:00 local time, which confirms the weekend skip at a glance. As a systemd timer the same intent is a service plus a timer carrying OnCalendar=Mon..Fri 09:00. Both fire at the same moments. The differences appear around the edges: the systemd version can add Persistent=true to catch up after a weekend powered off, and its output lands in the journal; the cron version can be copied to a BSD server or a hosting account and work untouched. The schedule is identical; the supervision around it is the real choice.

Limitations and honest notes

The builder covers standard five-field cron only. Seconds and year fields from Quartz-style schedulers are not included, and systemd calendar syntax is a different language entirely: the builder cannot check a .timer unit for you.

Next run times in the builder are calculated in your browser's local time. Servers usually run cron in UTC, and systemd timers follow the machine's configured time zone, so whichever scheduler you choose, confirm which zone the machine will apply. A correct expression in the wrong zone still fires at the wrong hour.

One cron behaviour matters for the comparison: when both day fields are restricted, a day matches if either field matches. Systemd calendar expressions have no such quirk; their date and weekday parts must both match. Schedules translated between the two can therefore drift.

Common mistakes

  • Assuming a timer exists because the unit files do. A timer does nothing until enabled and started; check with systemctl list-timers rather than trusting the files.
  • Comparing syntax instead of needs. The five fields versus calendar expressions debate is minor next to logging, dependencies and missed runs, where the two actually differ.
  • Letting a cron job fail silently. Redirect output to a log file or check results yourself; cron will not tell you a job broke.
  • Copying a cron schedule into a timer word for word. The day-field either-or rule differs, so a translated schedule can fire on extra days.
  • Forgetting the time zone on either system. Both schedulers fire in some zone; if you have not confirmed which, you do not know when the job runs.

FAQs

Is cron or systemd timers better? Neither is better in general. Cron is simpler and portable across almost any Unix-like system. Systemd timers give you logging, dependencies and catch-up behaviour, but only exist where systemd is the init system.

Can a systemd timer run a job every 15 minutes like cron? Yes. A timer unit with OnCalendar or OnUnitActiveSec can express intervals like every 15 minutes. The syntax is calendar-based rather than five fields, so it reads differently from a cron expression.

What happens to scheduled jobs when the machine is off? Plain cron simply skips them: a job due at 03:00 does not run if the machine was off at 03:00. A systemd timer with Persistent=true runs the missed job at the next boot.

How do I check a cron expression before using it? Paste it into the Cron Expression Builder. It explains the expression back in plain English and lists the next five run times in your local time zone, so field mistakes show up before deployment.

Does the builder support systemd timer syntax? No. It covers standard five-field cron only: minute, hour, day of month, month, day of week. Seconds and year fields from Quartz-style schedulers are not included either.

Conclusion

Cron and systemd timers solve the same problem with different trade-offs: cron gives you one portable line and leaves supervision to you, while systemd timers ask for unit files and repay you with logging, ordering and catch-up runs. Pick per job, not per ideology. For jobs that stay on cron, spend the thirty seconds the check takes: run the expression through the Cron Expression Builder, read its description and next runs, and only then save it. The companion guide walks through that testing routine in full: how to test a cron expression before you deploy it. More guides live in the Developer Tools guides archive.