I want to set the schedule for the eos.notifier to run the updater once a day at a fixed time. I know that you can do this with the configuration file under ~/.config/systemd/user/eos-update-notifier.timer, but I have no idea what I have to do. The goal is to have the updater running at 19:00 (7:00 pm) every day.
Essentially, set the OnCalendar
item:
https://wiki.archlinux.org/index.php/Systemd/Timers#Realtime_timer
Give me a mo and I can look at the specific timer.
OK, pretty straightforward:
sudo systemctl edit eos-update-notifier.timer
then add
[Timer]
OnCalendar=
OnCalendar=19:00
and that should be that.
This is adding an override file under /etc/systemd/system/eos-update-notifier.timer.d/
which will allow you to customise the unit without losing changes on an update - but make sure you remember about the changes.
The first line “unsets” the existing entry, the second line sets the specific time. Check the wiki page for other time formats.
No problem, I always note down everything I have set or changed. The list gets bigger and bigger.
The eos-update-notifier.timer is a user specific systemd thingy, so I think you must add option --user
to the command. Didn’t test it though because I’m not at a linux box right now.
I also noticed that a system-wide setting is ignored.
At what point would that --user
be written?
After systemctl
. Hope it works.
And no sudo.
EDIT: At least it works if you edit with a normal text editor directly, e.g.
nano ~/.config/systemd/user/eos-update-notifier.timer
After that run command
systemctl daemon-reload
That works perfect, many thanks.
How does this get installed? It doesn’t seem to be part of the PKGBUILD that I can see?
You mean how the timer gets installed?
It can’t be in the PKGBUILD since it is user specific.
eos-update-notifier has a .desktop file that is installed into autostart location (/etc/xdg/autostart). When user logs in, that .desktop file is called, and the .desktop file calls eos-update-notifier with the -init option.
Now eos-update-notifier knows how to install the user specific timer and start the service.
Hope this answers to your question.
Hmm. There may be a better way of doing that. You can run --user
services without having them present under $XDG_CONFIG_HOME
.
If you find a better way, please let me know!
I’m always open for new ideas to make this better.