Configuring a Realtime Timer Unit
Realtime timers activate on a calendar event, similar to events in a crontab. The option OnCalendar
specifies when the timer runs a service.
-
If needed, create a
.service
file that defines the service to be triggered by the timer unit. In the following procedure, the sample service is/etc/systemd/system/update.service
which is a service unit that runs an update script.For more information about creating service units, see Creating a User-Based systemd Service.
-
Decide the time and frequency for running the service. In this procedure, the timer is configured to run the service every 2 hours from Monday to Friday.
This task shows you how to create a system timer to trigger a service to run based on a calendar event. The definition of the calendar event is similar to entries that you put in a cron job.