Questions tagged [systemd-timer]
The systemd-timer tag has no usage guidance.
159
questions
0
votes
1
answer
23
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
31
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
64
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
110
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
56
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
71
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
60
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 ...
0
votes
0
answers
46
views
systemd timers with long lived processes, avoiding overlaps
I have script that will scan for tasks, and work on one at a time to completion and then exit. Execution can last 1s (no tasks) to 2hours (heavy task). And subsequent runs should start as soon as ...
0
votes
1
answer
60
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
269
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 (...
3
votes
1
answer
430
views
systemd timer every 1 hour and X minutes?
I'm looking for a systemd timer to run every 1 hour and 18 minutes but I have this only lead.
systemd-analyze --iterations=3 calendar *:0/18 which is every 18 minutes.
0
votes
0
answers
327
views
How do I correctly set up systemd-time-wait-sync.service
I have to set up a a timer with onCalendar=*:30 on a Raspberry Pi with no internet connection but using instead a battery powered RTC.
To sync my RTC I followed this post.
On the manual page of ...
0
votes
1
answer
608
views
When does the timer for 'OnBootSec' in a systemd timer unit actually start?
"On Boot" is ambiguous to me. Does it mean when booting starts, when booting finishes, mid boot, when timer.target is met? The documentation that I've read doesn't resolve this ambiguity.
1
vote
2
answers
223
views
How to avoid systemd periodic realtime timer running at boot
I have a realtime timer with Persistent=false running immediately after boot although my objective is to run it periodically!
I saw it is a rather common question but none of the answers I found in ...
0
votes
2
answers
2k
views
Unit templates and non-template destination units
I like to keep my custom unit files in their own directory away from /etc. In 247 this worked well, using something like the following:
systemctl enable /path/to/unit.service
This also worked with ...