Questions tagged [systemd-timer]
The systemd-timer tag has no summary.
163 questions
2
votes
1
answer
87
views
systemd timers OnCalendar looks like to start on the wrong time
I want to override the certbot timer on Debian 12. I want to start it at 04:00 CET ( 02:00 UTC )
I have created /etc/systemd/system/certbot.timer.d/override.conf
### Editing /etc/systemd/system/...
0
votes
0
answers
69
views
How properly calculate next time a systemd monotonic timer runs from its properties?
I was looking to get the exact formula that systemd uses for providing output such as this:
systemctl list-timers my
NEXT LEFT LAST PASSED UNIT ...
0
votes
0
answers
47
views
system service: scheduling a variable timer
I am writing a program that I would like to have the ability to schedule an action. This would work similar to the the TIME option in shutdown, where the user specifies a time and that information ...
1
vote
3
answers
879
views
Is it possible to start a systemd service a fixed time after 'start' is requested?
Bit of a funny question:
I have a systemd service where it is important that it actually executes (or fails) a fixed time after it is started.
My understanding is that once Linux calls start on the ...
0
votes
1
answer
79
views
How to get the gpg password prompt from a user's systemd timer unit?
I've written a short script to copy and encrypt my home dir for backup. I do this using
gpg --symmetric
I call this from my backup.service file, and it works fine: when I run systemctl --user start ...
2
votes
1
answer
121
views
Systemd timer with OnStartupSec and OnUnitActiveSec runs immediately at boot
I have this timer:
$ systemctl cat ansible-pull.timer
# /etc/systemd/system/ansible-pull.timer
[Unit]
Description=Starts ansible-pull
Requires=ansible-pull.service
[Timer]
OnStartupSec=10min
...
0
votes
1
answer
248
views
Timer "OnUnitInactiveSec=1day" is not triggered as expected
I wanted to run a service that runs once per day (exact time of day is not important right now).
My interpretation of
OnUnitInactiveSec= defines a timer relative to when the unit the timer is ...
0
votes
1
answer
75
views
Systemd timer only starts when service is stopped
I have a service that runs a python script:
[Unit]
Description="Daily python service"
[Service]
WorkingDirectory=/home/ubuntu/python_project/
ExecStartPre=/bin/bash -c 'truncate -s 0 /var/...
0
votes
1
answer
111
views
Is there a way to schedule a lazy timer relative to another timer?
(x-mas.service)
[Unit]
Description=Celebrate X-Mas
[Service]
Type=simple
ExecStart=/usr/sbin/x-mas-day
[Install]
WantedBy=multi-user.target
(x-mas.timer)
[Unit]
Description=Add "X-Mas" to ...
3
votes
1
answer
267
views
Managing ordering dependencies between systemd template instances
Abstracted example:
I have two recurring tasks A and B that I want to setup as systemd services. As the tasks are quite similar to each other, I am using a template [email protected]; A and B will be ...
2
votes
0
answers
166
views
Systemd - run bash script after user login on specific days
I use the i3 window manager and every day of remote work I would like to run a script that is responsible for setting up my monitors. On Tuesdays, I work onsite, then I'll want to run another script.
...
1
vote
1
answer
185
views
Ubuntu systemd service with timer is slow
I've set up a systemd timer to trigger a service every minute on Ubuntu 22.04, but I'm encountering an issue where the execution time of the service significantly increases after the first run. The ...
0
votes
1
answer
267
views
Systemd executable failed to read file from CacheDirectory with Permission Denied
I have a Golang binary that runs every 5 mins. It is supposed to create & update a text file which needs to be write restricted. To run this binary I created a systemd service and a systemd timer ...
1
vote
1
answer
219
views
How to indicate hour range in Timer using OnCalendar?
systemd 219 version
Ubuntu 22.04.2 LTS
[Unit]
Description=Run myscript.service every 5 minutes
[Timer]
OnCalendar= *-*-* 10-23:10/5:00
Persistent=true
[Install]
WantedBy=timers.target
I need to run ...
3
votes
1
answer
826
views
Why systemctl status shows a time in the future and the amount of time left?
When we issue "systemctl status", we usually get in the output, a line showing the status and for how long it has been in that status.
Like: (I issued that few minutes ago)
Active: active (...