systemd_timers
This is an old revision of the document!
Systemd timers, example
Lets say we want to start /home/heather/screenshot.sh
every day at 23:58, with the parameter 4.
- Create a service file
/etc/systemd/system/HeatherScreenshot.service
:[Unit] Description=HeatherScreenshot [Service] User=heather Type=simple ExecStart=/home/heather/screenshot.sh 4
- Create a timer file
/etc/systemd/system/HeatherScreenshot.timer
:[Unit] Description=Runs HeatherScreenshot [Timer] # DayOfWeek Year-Month-Day Hour:Minute:Second OnCalendar=23:58:00 Unit=HeatherScreenshot.service [Install] WantedBy=multi-user.target
- Test run the static service:
systemctl start HeatherScreenshot.service
- Start and enable the timer:
systemctl daemon-reload # if you modified the files systemctl start HeatherScreenshot.timer systemctl enable HeatherScreenshot.timer
systemd_timers.1483019995.txt.gz · Last modified: 2016/12/29 13:59 by admin