Questions tagged [systemd-timers]

11 questions
12
votes
2 answers

Why does my systemd timer only trigger once when the unit is a target?

I have a couple of services (static site generators) that I want to trigger on a regular basis from the same systemd timer. I found this question/answer, which covers exactly what I want to do, and describes a setup whereby a .target file that…
Paul
  • 301
2
votes
0 answers

Is there a system/computational overhead when using AccuracySec=1s in systemd timers

systemd timers by default have 1 minute accuracy, however it is easy to change that with AccuracySec parameter in the timer definition. I can't find any information related to whether setting accuracy to 1 second or less incurs penalty/overhead when…
2
votes
2 answers

Timer not started by userdata command after reboot

Issue description: On bootup we trigger the service initialization script that is shown below. The script is a part of Instance User Data. This script copies the necessary service/timer things to systemd folder and starts a timer. From time to time…
Cjoerg
  • 21
2
votes
1 answer

Is it possible to use both `After=` and `Before=` options towards the same unit (service) together in systemd service?

The Type=oneshot unit A.service is started hourly by A.timer and it Wants=B.service, but runs Before=B.service. Unit B.service is also Type=oneshot. The requirement here is that their processes should never overlap at run time (oneshot ensures…
2
votes
2 answers

Adding a once off triggering of a systemd timer

I have a systemd timer which runs at 23:00 on Fridays in order to do some batch data processing once a week during low demand times. It is Tuesday, and I would like to test a change I have made, I would like it to start at 23:00 today, so that I can…
Amandasaurus
  • 33,461
1
vote
1 answer

DNF-Automatic trigger set to run at unconfigured time

I am configuring dnf-automatic to automatically install security updates on some low priority test boxes. Eventually I want to the updates to run every Sunday morning around 4-5AM, but for testing purposes I've configured the boxes to kick off the…
1
vote
1 answer

sleep until this systemd timer calendar time occurs?

systemd has timers with lots of useful ways to input dates or times. I'm writing a long running data processing script. Is there any command to sleep until a specific systemd time definition occurs? e.g. systemd-timer-sleep --until-calendar="03:00",…
Amandasaurus
  • 33,461
1
vote
0 answers

Delay systemd timer until conflicting service has finished

I have multiple jobs that should be launched periodically by a systemd timer. The jobs are mutually exclusive - if one job was to be run while another one is still running, one of the jobs might produce invalid results or even crash. Because of this…
Manuel
  • 11
1
vote
1 answer

How to troubleshoot Ubuntu Certbot cron/timer?

lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.2 LTS Release: 20.04 Codename: focal and have installed certbot via apt-get My issue is that it is the second time that certificates…
1
vote
0 answers

Run two scripts one after another with a systemd service

I have two scripts, what I would like to do is: at 1am, the first one runs once the first one stops, and this is a condition, the second one fires So, should i use: [Service] ExecStartPre = script.py ExecStart = secondscript.py or [Service] Type…
0
votes
1 answer

Systemd timer triggered after suspend despite persistent=false?

I cannot understand how systemd timers are supposed to behave when the host is suspended: Here is a simple service: foo.service [Unit] Description=Test timer [Service] Type=simple ExecStart=echo "TEST TIMER" And the corresponding timer:…