TOOL » LINUX » SYSTEMCTL

Timer

Usage

start enable stop or disable the timer:

shell
sudo systemctl enable mytimer.timer

Check the timers status with:

shell
systemctl list-timers --all

Creation

Place the timer unit under /etc/systemd/system.

Example of mytimer.timer:

ini
[Unit]
Description=mytimer

[Timer]
OnStartupSec=3h
OnUnitActiveSec=3h
OnCalendar=*:0/10

[Install]
WantedBy=timers.target
SettingDescription
OnStartupSecActivate the timer relative to boot time.
OnUnitActiveSecActivate the timer relative to last activation time.
OnCalendarDefines realtime (cron-like) timers.