Calendar Schedules: OnCalendar

Running at clock times

OnCalendar schedules a job at real clock times. It accepts handy shortcuts (hourly, daily, weekly) and a precise format, DayOfWeek Year-Month-Day Hour:Minute:Second, where * means “every”:

OnCalendarWhen it runs
hourlyThe top of every hour
dailyEvery day at midnight
*-*-* 09:00:00Every day at 09:00
Mon *-*-* 08:30:00Every Monday at 08:30
*-*-01 00:00:00Midnight on the 1st of each month

Here's a timer that runs its service every day at 06:00. After reloading, list-timers shows when it will next run:

sudo tee /etc/systemd/system/report.timer > /dev/null <<'EOF'
[Unit]
Description=Daily report

[Timer]
OnCalendar=*-*-* 06:00:00
Persistent=true

[Install]
WantedBy=timers.target
EOF
sudo systemctl daemon-reload
sudo systemctl start report.timer
systemctl list-timers report.timer --no-pager

In the terminal

student@vulntech:~$ sudo tee /etc/systemd/system/report.timer > /dev/null <<'EOF'
> [Unit]
> Description=Daily report
> 
> [Timer]
> OnCalendar=*-*-* 06:00:00
> Persistent=true
> 
> [Install]
> WantedBy=timers.target
> EOF
[sudo] password for student:
student@vulntech:~$ sudo systemctl daemon-reload
student@vulntech:~$ sudo systemctl start report.timer
student@vulntech:~$ systemctl list-timers report.timer --no-pager
NEXT                        LEFT     LAST PASSED UNIT         ACTIVATES
Mon 2026-10-19 06:00:00 UTC 22h left -    -      report.timer report.service

1 timers listed.
Pass --all to see loaded but inactive timers, too.

Persistent=true tells systemd to run a job it missed (because the machine was off) as soon as it's back — so a nightly backup still happens even if the server was down at 2am.

Tip: systemd-analyze calendar "daily" explains a schedule and shows the next time it would fire — a quick way to check an OnCalendar line before relying on it.

Remember: OnCalendar sets clock schedules: shortcuts like daily/hourly, or DOW Y-M-D H:M:S with * for “every”. Persistent=true catches up a missed run.

HOME LEARN COMMUNITY DASHBOARD
Practice terminal Starting…