HN Debrief

Love systemd timers

The post is a pro-systemd pitch aimed at one of the most familiar Unix tools: cron. It argues that systemd timers are a better default for scheduled work on modern Linux because they pair schedules with first-class service units, integrate with journald, can be started manually for testing, support catch-up behavior for missed runs, and offer knobs like randomized delays and persistent execution after downtime. In plain terms, the claim is not that cron cannot run jobs, but that timers make scheduled jobs behave more like managed services than fire-and-forget shell commands.

For teams already standardized on systemd, timers reduce operational friction by making scheduled jobs observable, testable, and easier to coordinate, though they also deepen dependence on a complex subsystem with sharp edges.

Discussion mood

Mostly positive about systemd timers as an operational upgrade over cron, especially for observability, testing, missed-run handling, and fleet-friendly scheduling. The negativity centered on systemd's complexity, extra boilerplate, non-obvious file layout, and fear that when it misbehaves it fails opaquely.

Key insights

  1. 01 The real gain is that timers schedule ordinary service units, not shell snippets living in a separate universe.
    That collapses testing, execution, logging, and monitoring into the same path. If `systemctl start foo.service` works, the timer will run the same unit with the same environment model and the same logs, which is a much cleaner operational contract than editing a crontab and waiting to see what happened.

    Timers are compelling because they turn scheduled work into managed services. That is an operational improvement, not a syntax improvement.
      Attribution:
    • jeroenhd #1
    • mike_hock #1
    • jchw #1
    • kayson #1
  2. 02 systemd timers handle "real machine" behavior better than classic cron defaults.
    `Persistent=true` lets a missed daily job run after the system comes back, and `RandomizedOffsetSec` or related delay settings spread jobs across hosts without homegrown sleep wrappers or config-management tricks. That combination is why backups came up so often. It matches laptops, home servers, and fleets better than "run exactly at minute N or not at all."

    If machines sleep, reboot, or come and go, timers fit reality better. Cron assumes a steadier host than many teams actually have.
      Attribution:
    • gchamonlive #1
    • mid-kid #1
    • PunchyHamster #1 #2
  3. 03 systemd's timer model is broader than cron's five-field schedule, and that matters more than whether `OnCalendar` feels pretty.
    You get wall-clock schedules, monotonic intervals like `OnActiveSec=6h`, seconds and years in calendar expressions, timezone-aware schedules, and more irregular dates without shell hacks. The syntax is not universally easier, but the scheduler itself is more capable.

    The advantage is expressive power built into the scheduler. Simplicity depends on what kinds of schedules you actually need.
      Attribution:
    • ecnahc515 #1
    • max-privatevoid #1
    • simoncion #1
    • harshreality #1
  4. 04 A lot of the value only shows up once you care about coordination across many jobs or many hosts.
    systemd gives you dependencies like `Wants=` and `Requires=`, stable jitter to avoid thundering herds, unified inspection with `list-timers`, and a common way to launch work whether it is timer-driven or not. That is mundane on one server and genuinely useful at fleet scale.

    Timers are not just a cron replacement. They are part of a broader service orchestration model that pays off more as systems get larger.
      Attribution:
    • zbentley #1
    • sophacles #1
    • PunchyHamster #1

Against the grain

  1. 01 Cron still wins on immediacy.
    One line in a crontab or a script dropped into `/etc/cron.daily` is easier to discover, easier to explain to occasional admins, and lighter than creating separate service and timer units. For many people the issue is not capability. It is friction and cognitive overhead for straightforward jobs.

    If the job is simple and rarely touched, cron's minimalism is a feature. Boilerplate is a real cost.
      Attribution:
    • thomashabets2 #1
    • pkal #1
    • PenguinCoder #1
    • naikrovek #1
  2. 02 systemd's biggest risk is not day-one setup.
    It is day-500 debugging when a timer silently wedges because of some obscure interaction. A report of a logrotate timer that stopped firing on one production VM, apparently matching an old upstream bug, captured the core fear: the more you rely on systemd's integrated model, the more you inherit failures that are hard to reason about and hard to escape.

    Operational polish cuts both ways. A tightly integrated platform is great until the platform itself is the problem.
      Attribution:
    • simoncion #1 #2
  3. 03 Several headline systemd advantages are actually implementation-specific comparisons against the weakest version of cron.
    `RANDOM_DELAY`, `CRON_TZ`, and anacron-style catch-up behavior already exist in some cron stacks. So the clean comparison is not "timers versus cron" in the abstract. It is "timers versus the cron implementation your distro actually ships."

    Do not compare systemd to a straw-man cron. Some of the gap is real, but some is distro packaging and feature variance.
      Attribution:
    • simoncion #1
    • 6031769 #1
    • mid-kid #1

Reference links

systemd timer docs and tools

cron references and alternatives

Bugs and operational gotchas

Related projects and examples

  • borg-automated-backups
    Example repository showing backup automation built around systemd timers
  • dron
    Suggested tool for generating many systemd units instead of hand-writing them
  • waitlock
    Mentioned as a simple tool for semaphore-style job coordination when using scheduled jobs
  • Step CA templates write-up
    Referenced as an example of using systemd template units to schedule certificate renewals