Questions tagged [systemd-timer]
The systemd-timer tag has no usage guidance.
126
questions
2
votes
0
answers
59
views
How to edit a systemd timer where persistent=true?
This on a Raspberry Pi 4 running Buster.
I have a systemd timer that runs once a day at a particular time. I also have persistent=true. I want to change that time. But, if I edit the file with a new ...
0
votes
0
answers
21
views
Timers in systemd: monthly timer -> service A -> 24h wait timer -> service B: is this possible?
I have the following setup:
zfs-scrub.service
zfs-scrub.timer
zfs-status.service
zfs-status.timer
zfs-scrub.timer starts zfs-scrub.service every 2nd and 16th day of the month. I would like to ...
1
vote
1
answer
76
views
How to create an ephemeral user-level systemd timer on the commandline without unit/timer files?
Suppose I want to run the command notify-send "invoked" "$(date)" every 5 seconds using systemd timers.
I know how to create a corresponding unit file and a timer file, then enable ...
0
votes
1
answer
32
views
Systemd: Start service if a path is found but only between 9AM and 6PM
I wonder if there's some way to have both the functionality of a Path unit and a Timer. The idea is to start a specific service if a path on the system is found but only between 9AM and 6PM.
Currently ...
0
votes
1
answer
85
views
systemd timer does not display trigger & does not repeat
As explained in GoAccess 1.4 detailed tutorial, I've create a goa-daily.timer
[Unit]
Description=Daily update of GoAccess reports
[Timer]
# Every day @ 3 O'clock
OnCalendar=*-*-* 03:00:00
...
0
votes
1
answer
111
views
Trouble with keeping process launched by systemd service alive
I am trying to to get my first systemd service working as desired. Here is what I have:
gateway-watchdog.service:
# A systemd service for the Gateway Watchdog
[Unit]
Description=gateway-watchdog: ...
1
vote
1
answer
166
views
disabled/static systemd service unit is always started at reboot (systemd timers as cron replacement)
Summary
A systemd service unit that is disabled ("static") and is only supposed to be triggered by a timer is run on every reboot.
Background
This was a service unit (in /etc/systemd/system/)...
0
votes
3
answers
75
views
What is the easiest way to run a program from time X to time Y?
There is a certain potentially failing process that I want to run until it succeeds, during the night time, say, from 23:00 to 7:00, but not later.
A possible solution would be to:
Add a cron job for ...
0
votes
0
answers
32
views
What is the most efficient way to run a task every X hours of runtime, accumulated over all power-ons?
Let us assume that I have a machine which wakes up at 7:00, does some work, usually for 15 minutes, but sometimes for days (e.g., experiment supervision), and after the works is done, it powers ...
0
votes
1
answer
239
views
OnCalendar systemd timer unit still executes at boot, how to stop it?
I have the following unit enabled and started
[Unit]
Description=Schedule a nightly execution at 03.15 for Backup ROOT
# Allow manual start
RefuseManualStart=no
# Allow manual stop
RefuseManualStop=no
...
0
votes
1
answer
222
views
Systemctl service not killed after timeout on RuntimeMaxSec
My script runs every minute (with systemctl timer) but it will occasionally hang for ever, meaning that unless I manually stop it, it won't run again. So I implemented a timeout with RuntimeMaxSec but ...
0
votes
0
answers
43
views
"systemctl list-timers" shows 2 days left for a "daily" timer
I created a systemd timer with the following specification
[Timer]
OnCalendar=daily UTC
OnBootSec=1minute
OnClockChange=true
Persistent=true
AccuracySec=1minute
I wanted to test how the daily UTC ...
0
votes
1
answer
27
views
Changing Unit Configuration to restart httpd every 3s
I tried to add the following with systemctl edit httpd.service and this created /etc/systemd/system/httpd.service.d/override.confcontaining :
[Unit]
Restart=always
RestartSec=3
now after systemctl ...
0
votes
0
answers
42
views
systemd-analyze reporting excess time in systemd-analyze plot graph
Hello Systemd experts,
I am facing a strange problem when I am trying to use systemd-analyze to benchmark the startup time. I have below service
**[Unit]
Description = Some Important service
Before = ...
0
votes
1
answer
260
views
Is it possible to dynamically update systemd-timer's onCalendar?
sytemd-timer has a feature "onCalendar" using which we can execute a script on points of time (on calendar).
Is it possible to dynamically (programmatically) update or mutate that field?
For ...
2
votes
1
answer
452
views
How to bind a user-level systemd service to network events?
I want to bind a user systemd timer (or service) to network events. For example consider this service:
[Unit]
Description=shows if connection changed
[Service]
Type=oneshot
Environment=DISPLAY=:0
...
6
votes
1
answer
796
views
How to make a systemd-timer depend on internet connectivity?
I'm using systemd-timer to periodically run a script which consumes a webservice.
Problem is, upon system resume or wake-up, internet connectivity would not get started right away but the timer gets ...
1
vote
1
answer
80
views
systemd daily timer quits scheduling new events
I've been using a systemd timer reliably for months, but recently got alerted that the triggered service job hadn't run. When I used systemctl list-timers, indeed I saw that no more triggering events ...
1
vote
1
answer
41
views
Hourly systemd timer for work hours when end of day is after midnight?
I would like to run a systemd service hourly from 9am in the morning to 1am at night (one hour past midnight local time).
As a starting point I can use a time specification similar to the following to ...
0
votes
2
answers
171
views
Have systemd timer to run immediately when started?
I have a timer that should run every 60 seconds like this:
[Unit]
Description=Trigger test timer
[Timer]
OnActiveSec=60
The timer triggers after waiting 60 seconds. But I want it to trigger ...
0
votes
1
answer
41
views
Directory mtime is not updated when creating a file in it only through a systemd timer, works fine when running the same command manually
I have the following service unit to back up my project database:
[Unit]
Description=%i mysql backup for `apples` database
After=mysqld.service
Requires=mysqld.service
[Service]
User=root
...
0
votes
1
answer
235
views
Systemd Timer has no trigger
My systemd timer is configured the following way which should execute its service every 5 minutes.
[Unit]
Description=Sync mail
[Timer]
OnCalendar=*:0/5
Unit=mail.service
[Install]
WantedBy=multi-...
5
votes
2
answers
310
views
How to reset left time of user systemd timer
How can I reset the left time of a user systemd timer?
I have a user systemd service:
[Unit]
Description=Remind to a take break
[Service]
ExecStart=/opt/scripts/break_reminder
Environment=PATH=/sbin:/...
0
votes
1
answer
352
views
systemd-timer: undocumented "AccuracySec=0"
Can anyway tell me where is the document for "AccuracySec=0" of systemd-timer? The most closed document I found is "AccuracySec=1us". I know the meaning of AccuracySec but just ...
0
votes
1
answer
395
views
Multiple Instances of Unit= in Path or Timer Unit?
Can multiple instances of Unit= exist in a systemd.path or systemd.timer unit? Or, must one instead specify multiple instances of the path or timer unit, each with a single instance of Unit=? I ...
0
votes
1
answer
241
views
Should i use default.target or timers.target value for WantedBy for a systemd user timer? [duplicate]
My .timer file located in ~/.config/systemd/user doesn't show in output of systemctl --user list-timers --all command unless i enable it. Is it normal for this command to not show disabled .timers ...
1
vote
1
answer
172
views
Install systemd timer + service silently with dh_installsystemd
I have a systemd service+timer that I'd like to install which does not match my packagename.
# debian/mypackage.myscript.timer
[Timer]
OnCalendar=weekly
Persistent=true
[Install]
WantedBy=timers....
1
vote
1
answer
340
views
Trying to stop systemd timers from triggering missed events
After trying the solutions posted here (Prevent systemd timer from running on startup), I thought I had my systemd timer problems corrected. However, after my last reboot, my service fired off during ...
1
vote
1
answer
172
views
Systemd timer triggers only once
My systemd timer is configured to run ever day at 3:00.
The timer gets triggered only on the first day at 3:00 and systemd list-timers says n/a in the Left or Next column.
borgbackup.timer:
[Unit]
...
0
votes
0
answers
120
views
Can a multiple systemd services be controlled through a single systemd timer?
A foo.service service can be controlled by a foo.timer. Is it possible the make a single systemd timer controlling multiples systemd services?
0
votes
2
answers
612
views
systemctl Persistent timer and service, when computer turned off
How do the systemctl timer works when the computer is turned off at the given trigger time?
There is the option "Persistent", but when exactly is the command executed?
In how far is it ...
1
vote
1
answer
2k
views
How to make a systemd timer that runs every 2 days? [duplicate]
I am looking a guide to understand how OnCalendar works. I don't understand ..... Please how can I make a systemd timer runs every 2 days?
[Unit]
Description=systemd every 2 days.
[Timer]
OnCalendar=*...
2
votes
1
answer
121
views
Systemd timers will not fire
I have a very weird issue on Debian Buster. I've enabled unattended-upgrades on the server as this is a very bare bones server and it should just update automatically. However, it seems that the apt ...
0
votes
1
answer
282
views
systemd timer every X hours on a specific day
I want a timer for a specific day (every year specific month and day) repeating every 8 hours on that day (birthday reminder).
I have tested several including:
[Unit]
Description=Tom Birthday
Requires=...
1
vote
1
answer
175
views
Systemd timer running scheduled service 2 times in a row, instead of running only 1 time
I have a nodejs gui program (does not requires user interaction), which needs to be run at every 40th minutes at each hour. Say run at 05:40PM, 06:40PM, 07:40PM and so on. In a Debian server, I have ...
1
vote
0
answers
128
views
systemd dbus service continuously updates system time
I am trying to set my centos vm's date to 1 months prior date for some license validation,
for that I have disabled systemd-timesyncd and ntpd service but still after setting the time to -32 days the ...
0
votes
1
answer
113
views
systemd timer on boot but not too often
Would it be possible to create a timer that will run a service on a boot, but not more often than once a week?
In my case it would be beneficial to run a TRIM (fstrim) for SSD disk on a boot, but once ...
0
votes
1
answer
36
views
Mixing conditions in Linux timer
I want to create a timer that fires, completes execution, waits for 30 seconds and fires again but only during night hours. So far I got this:
[Timer]
OnUnitInactiveSec=30s
OnCalendar= * - * - * 23,24,...
1
vote
1
answer
1k
views
systemd timer every 8 hours
I am fairly new using systemd timers, and I am having some issues.
I am trying to schedule a script that runs daily, every 8 hours, at 6 AM, 2 PM, and 10 PM. The time starts correctly, and it shows ...
1
vote
1
answer
92
views
How systemd timer work?
I have myscript.service and I want this service to start every hour.
So I wrote myscript.timer
Description=My script timer
[Timer]
OnCalendar=hourly
;OnCalendar=*-*-* 0/2:00:00
[Install]
WantedBy=...
0
votes
1
answer
101
views
systemd timer is running task on every computer restart
I use Ubuntu.
This is /etc/systemd/system/myapp.service:
[Unit]
Description=...
After=network.target
StartLimitIntervalSec=60
[Service]
Type=simple
Restart=no
StartLimitIntervalSec=0
User=myuser
...
1
vote
0
answers
144
views
How do I create a systemd service for a continuously running application (only in a time window)
I have a software that basically continuously analyze a camera stream and send some information to a server, this is a headless system (Ubuntu 16.04). The application must be started every day (except ...
1
vote
1
answer
2k
views
Systemd: How to get a timer to run after a required service?
Currently, I have this systemd timer (my.timer):
[Unit]
Description=My Timer
[Timer]
OnActiveSec=30
Unit=my-subsequent.service
[Install]
WantedBy=multi-user.target
The timer is set to activate ...
3
votes
1
answer
295
views
systemctl start foo.timer also starts foo.service even though the OnCalendar criteria hasn't been met
So I have my service unit (runs some node code) and my timer unit
Service:
[Unit]
Description=foo
[Service]
Type=oneshot
ExecStart=/home/ubuntu/services/foo/start.sh
Timer
[Unit]
Description=foo ...
0
votes
1
answer
342
views
systemd timer for target that calls template
I have a systemd template, load@.service defined as:
[Unit]
Description=load script
Wants=network-online.target
After=network-online.target
PartOf=load.target
[Service]
Type=simple
ExecStart=/usr/bin/...
0
votes
1
answer
118
views
systemd service failed
Im trying to write a systemd unit for autoupdate system every Friday after 18:00. And everything work fine if I start service manually via systemctl start --user autoupd.service.
* autoupd.service - ...
0
votes
1
answer
134
views
Systemd: running a 15 minute job every 15 minutes
I want to set up scripts and systemd timers to allow 24x7 dumping of 8 RTSP streams to disk, in 15 minute chunks, each starting on the quarter hour.
I start with a script to do the dumping for 15 mins ...
1
vote
0
answers
153
views
Systemd timer every second Monday?
It is possible to run a timer every 15 minutes like so:
OnCalendar=*:0/15
Is there a way to run that timer every second Monday?
0
votes
2
answers
541
views
How to include and install debian/package.timer file inside deblan package, alongside the package.service
I'm creating a debian package which comprises of a service and some shell scripts and would like to also install a timer in the /lib/systemd/system folder so that the service will get called ...
2
votes
1
answer
461
views
systemd User Timer Not Repeating
I'm trying to run a systemd timer every minute as a user, but it isn't repeating after the initial trigger. The ffmpeg-timelapse.timer is configured with the OnCalendar=minutely to fire every minute, ...