Using Timer Units to Control Service Unit Runtime
Timer units can be configured to control when service units run. You can use timer units
instead of configuring the cron
daemon for time-based events. Timer
units can be more complicated to configure than creating a crontab entry. However, timer
units are more configurable and the services that they control can be configured for
better logging and deeper integration with systemd
architecture.
Timer units are started, enabled, and stopped similarly to service units. For example, to enable and start a timer unit immediately, type:
sudo systemctl enable --now myscript.timer
To list all existing timers on the system, to see when they last ran, and when they're next configured to run, type:
systemctl list-timers
For more information about system timers, see the systemd.timer(5)
and
systemd.time(7)
manual pages.