Skip to content
_CORE
AI & Agentic Systems Core Information Systems Cloud & Platform Engineering Data Platform & Integration Security & Compliance QA, Testing & Observability IoT, Automation & Robotics Mobile & Digital Banking & Finance Insurance Public Administration Defense & Security Healthcare Energy & Utilities Telco & Media Manufacturing Logistics & E-commerce Retail & Loyalty
References Technologies Blog Know-how Tools
About Collaboration Careers
CS EN DE
Let's talk

Cron and Systemd Timers

02. 04. 2023 Updated: 24. 03. 2026 1 min read intermediate
This article was published in 2023. Some information may be outdated.

Cron and Systemd Timers

Cron is the traditional approach, systemd timers are the modern alternative with better integration.

Cron

crontab -e

m h dom mon dow command

0 2 * * * /opt/backup.sh */5 * * * * /opt/check.sh 0 2 * * * /opt/backup.sh >> /var/log/backup.log 2>&1 * * * * * flock -n /tmp/task.lock /opt/task.sh

Systemd Timers

backup.timer

[Timer] OnCalendar=*-*-* 02:00:00 Persistent=true [Install] WantedBy=timers.target

backup.service

[Service] Type=oneshot ExecStart=/opt/backup.sh systemctl enable –now backup.timer systemctl list-timers

Comparison

  • Logs: cron -> syslog, timer -> journalctl
  • Dependencies: timer -> After=, Requires=
  • Resource limits: timer -> via service
  • Persistent: timer catches up on missed runs

Timers for New Projects

Use systemd timers for new projects. Cron for simple legacy tasks.

cronsystemdtimers
Share:

CORE SYSTEMS team

We build core systems and AI agents that keep operations running. 15 years of experience with enterprise IT.