systemd-timer for qubes-sync-clock

39 views
Skip to first unread message

Niels Kobschätzki

unread,
Jul 17, 2016, 1:33:06 AM7/17/16
to qubes-users
Hi,

since I prefer systemd-timers over cron jobs (systemctl list-timers is great and
they log automatically to journalctl), I created a service and a timer for it. I have no
idea what would be the best way to create a pull-request for them, so I post
them here:

When you create them yourself you can put them in /etc/systemd/system

qubes-sync-clock.service
[Unit]
Description=This syncs the clock

[Service]
type=simpel
ExecStart=/usr/bin/qvm-sync-clock

[Install]
WantedBy=default.target


qubes-sync-clock.timer
[Unit]
Description=Sync the clock every 6 minutes

[Timer]
Persistent=false
OnBootSec=15
OnCalendar=*:0/6
Unit=qubes-sync-clock.service

[Install]
WantedBy=timers.target

When you have both files:
systemctl start qubes-sync-clock.service
systemctl enable qubes-sync-clock.service
systemctl start qubes-sync-clock.timer
systemctl enable qubes-sync-clock.timer

When you want to see when the timer ran the last time and will run the next
time:
systemctl list-timers

And when there is something to log, it is in the journal (journalctl)

The interesting man-pages:
* systemd.timer(5)
* systemd.time(7)

I have not that much experience with services/timers, so I just adapted what I
use for my personal timers…

Niels

Iestyn Best

unread,
Jul 18, 2016, 8:35:40 PM7/18/16
to qubes-users
Thanks Niels, looks like a quick way to port it to the systemd interface.

How is it working?

Reply all
Reply to author
Forward
0 new messages