Docs / Linux Basics / How to Use systemd Timers Instead of Cron

How to Use systemd Timers Instead of Cron

By Admin · Feb 25, 2026 · Updated Apr 23, 2026 · 316 views · 1 min read

Systemd timers are a modern alternative to cron for scheduling tasks.

Create a Service Unit

Create /etc/systemd/system/mybackup.service:

[Unit]
Description=My Backup Script

[Service]
Type=oneshot
ExecStart=/usr/local/bin/backup.sh

Create a Timer Unit

Create /etc/systemd/system/mybackup.timer:

[Unit]
Description=Run backup daily

[Timer]
Persistent=true

[Install]
WantedBy=timers.target

Enable the Timer

systemctl daemon-reload
systemctl enable --now mybackup.timer

Check Timer Status

systemctl list-timers
systemctl status mybackup.timer

Was this article helpful?