IT-LINUXMAKER, OpenSource, Tutorials

Systemd timer is intended to replace existing cron jobs.

Older versions of Linux use the cron daemon to schedule tasks. However, the cron daemon is no longer recommended for new installations. Instead, you should use the systemd timer. Cron dates back to a time when Linux systems were much simpler. While it still works, it has some structural drawbacks.

  • No reference to the system state
    • Cron does not know if the system is currently booting, was in sleep mode, or if services are not yet running.
    • Jobs are simply lost if the computer is switched off at the scheduled time.
  • Weak error and logging handling
    • Logs are scattered or minimal.
    • Errors often have to be handled via email or custom scripts.
  • Hardly any dependencies
    • Cron cannot cleanly say: "Start this job only when service X is running".
  • Separate world
    • Cron lives completely outside of systemd, which is now the central init and service system.

All of this can be handled with systemd-Timer. Therefore, this section will demonstrate the simple setup and administration of these timers.

What exactly is systemd? And why is it so central to modern Linux systems?

Systemd is the init system of modern Linux distributions. Earlier versions used SysVInit, the init system under the Unix operating system System V, based on the UNIX philosophy of "one program, one task." Each service was started, configured, and stopped as an independent script. Systemd, on the other hand, is a monolithic init system. It therefore handles not only starting services but also logging (journald), timers, socket activation, and much more. This brings us to the heart of systemd's main tasks:

 

  • System startup (boot process)
    • systemd is the first process after the kernel.
    • It starts all the important services in the correct order.
  • Service Management
    • Start, stop, and reload services.
    • Automatically restart services if they crash.
  • Logging
    • journalctl allows you to easily search all logs.
    • This results in more unified management instead of scattered log files.
  • Resource management
    • Limiting CPU, RAM, or network resources for specific services is feasible.
  • Timers and automation
    • systemd can handle time-controlled tasks similarly to cron, but much more flexibly.

IT-LINUXMAKER, OpenSource, IT-Support, IT-Consulting

© IT-LINUXMAKER 2026