systemd timer daily at specific time

I had to change the daily timers time of execution, I wanted it to start at 8am so had to change ~/.config/systemd/user/timer-daily.timer from monotonic to realtime.

[Unit]
Description=Daily Timer

[Timer]
# OnBootSec=10min
# OnUnitActiveSec=1d
# Daily at 8am
OnCalendar=*-*-* 08:00:00
Persistent=True
Unit=timer-daily.target

[Install]
WantedBy=basic.target

Next daemon-reload

$ systemctl --user daemon-reload

And voila:

$ systemctl --user list-timers
NEXT                         LEFT        LAST                         PASSED        UNIT               ACTIVATES
Sun 2015-02-15 09:47:17 CET  18min left  Sun 2015-02-15 08:47:17 CET  41min ago     timer-hourly.timer timer-hourly.target
Mon 2015-02-16 08:00:00 CET  22h left    Sun 2015-02-15 09:28:14 CET  25s ago       timer-daily.timer  timer-daily.target
Fri 2015-02-20 10:21:17 CET  5 days left Fri 2015-02-13 10:21:17 CET  1 day 23h ago timer-weekly.timer timer-weekly.target

For more about systemd.timer check http://www.freedesktop.org/software/systemd/man/systemd.timer.html

Advertisements

About Michal Zuber

Full stack developer, biker and rollerblader. Owner and developer at https://nevilleweb.sk/ Co-founded http://neville.sk/ Blog at https://michalzuber.wordpress.com/
This entry was posted in linux and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s