Questions tagged [systemd-timer]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
0answers
18 views

systemd activates unit ran by timer upon changing the OnCalendar directive

I have a systemd timer setup with this OnCalendar value: OnCalendar=*-*-* 05:35:00 Upon changing it to OnCalendar=*-*-* 06:35:00 And running systemctl daemon-reload to reload the configratuion ...
1
vote
1answer
14 views

Systemd service fired by a timer doesn't always execute its program

We have a server running a bunch of cron jobs which we wanted to move to systemd timers. In the process of creating the .service and .timer files, I came across this bug on CentOS (which we are using)....
1
vote
1answer
38 views

rsync command doesn't work when run as a systemd service

summary: I am trying to set up a systemd timer to regularly backup a directory using the rsync command. I made an rsync command that works when run manually in a terminal, but it doesn't work ...
1
vote
1answer
27 views

Systemd timer will not fire

I have a timer that is literally this: foobar.service: [Unit] Description=Timer Test Requires=rsyslog.service # rsyslog is an active local service. [Service] Type=simple ExecStart=/usr/bin/...
0
votes
0answers
15 views

systemd-poweroff.timer fails to shut down machine

I have a Timer file systemd-poweroff.timer that is supposed to shut down a machine at 3am. [Unit] Description=Halt machine at 3am [Timer] OnCalendar=3:00 Persistent=true [Install] WantedBy=timers....
0
votes
0answers
18 views

Setting a property on a systemd timer unit

I have been using the crontab for some time, but I'm entirely new to managing timer units through systemctl. I have been a CentOS 5/6/7 user, and now I want to move to 8, which has undergone a massive ...
1
vote
1answer
41 views

How to continuously run a script with systemd

I wrote a very simple script (checkaudio.sh) that publishes a message from a file on a mqtt topic. I would like the script to run continuously (I would be happy even with every second). I first tried ...
0
votes
1answer
29 views

Running a systemd service everyday, not at a specific time

Specifying daily as the OnCalendar attributes makes a service run at 00:00 everyday. Is it possible to specify a minimum execution interval, like 6 hours, for a systemd timer, so that it will be ...
0
votes
1answer
60 views

systemd timer: enable service for specific time ranges only

Say I want a a program to be active between 12:00h and 13:00h on a desktop machine (i.e. if PC is on at either time cannot be guaranteed). I'll assume I can use systemd units for this. Starting ...
2
votes
2answers
47 views

Embedded Linux - Constant Loop time

I am using a Colibri iMX6 DualLite SoM from Toradex. It is based on a multicore ARM Cortex™A9 processor. I'm running an Embedded Linux distribution provided by toradex in it. We are developing a ...
4
votes
1answer
215 views

Restart systemd .service with .timer unit

I have the following systemd myscript.service unit that executes an script: [Unit] Description=MyScript Wants=time-sync.target [Service] Type=oneshot RemainAfterExit=true ExecStart=/usr/local/bin/...
0
votes
0answers
106 views

Systemd unit fails to start after restart of server

I have a rather strange situation where an unit fails to start after a restart of the server. To me the issue seems to be caused by the fact that SystemD tries to stop (!) the service before it starts ...
0
votes
0answers
20 views

Stop systemd-run after a set time

My question is similar to Start/stop a systemd.service at specific times, but deals with one-off processes scheduled with systemd-run rather than systemd timer files. I want to record fm transmissions ...
0
votes
0answers
25 views

systemd timer runs more than once per period even with persistent=false

I have a unit that normally I want running, but sometimes I want to manually shut it off for the day and restart it later automatically. So I have a timer to restart it OnCalendar=daily. This works, ...
0
votes
0answers
48 views

Systemd: Wait Until Service Is Inactive

The foo.service (which is oneshot type) is regularly activated by foo.timer and then runs for some time. The bar command must not be runed while foo.service is active. So, before running bar, which ...
0
votes
1answer
49 views

How the keyword `After` works in systemd service?

I have prepared two services a.service and b.service. The a.service run using a.timer. a.service [Unit] Description=service a After=network-online.target Wants=network-online.target [Service] Type=...
1
vote
0answers
81 views

Set systemd timer to an odd and specific number of days

I'm using systemd.timers on CentOS 7 server and have a timer set to automatically renew Certbot-managed Let's Encrypt website certificate. autorenewal.service: [Unit] Description=certbot certificate ...
0
votes
1answer
117 views

Make calendar systemd timers run after boot if the machine was powered off

I'm using a Laptop with GNU/Linux and I would like certain jobs to run automatically on certain calendar events even if the machine was off. I understand I should use the OnCalendar= directive but ...
1
vote
2answers
2k views

How to run systemctl command inside ExecStart?

I am trying to restart all the stale sqlrelay connection services using systemd.timer. Systemd service looks like this: [Unit] Description=sqlrelay-state-connection-restart [Service] Type=oneshot ...
1
vote
0answers
103 views

systemd: Retrying a timer

I'm using borgbackup to back up a few systems. They all use the same borgbackup repository. I have written a systemd timer that starts a backup job using borgmatic. I have an Ansible playbook that ...
1
vote
0answers
246 views

Systemd timer is lost after reboot?

I'm working on Fedora 29 x86_64, fully patched. I have a timer and a service. When the timer fires it starts the service. The service runs a script, and the script exits after about 10 seconds. I can'...
1
vote
0answers
60 views

Systemd timer that runs until success, then enable again the next day

I'm fetching data files from a server owned by someone else. The data files are posted once a day between 6:00 AM and 12:00 Noon. Once I fetch the file for a given day I don't need to check again ...
-1
votes
1answer
416 views

Systemd timer and mount not found

I'm trying to set up a systemd time that runs every 4 hours. When the timer fires a script is run to update some data files. I followed systemd timer every 2 hours at 30 minutes past the hour? and ...
1
vote
3answers
320 views

Systemd timer every minute between 09:15 - 17:15 [duplicate]

i need a service to start every minute between 09:15 - 17:15. Whats the best way to achieve this? I could make 3 timers, one to start (1) the timer (2) which runs the service every minute and one to ...
1
vote
2answers
2k views

Pipe output of script through Exec in systemd service?

So I'm trying to set up a systemd service in order to launch a set of files on a daily basis (different types of journals) from directories based off the date. For example a todo list for today would ...
0
votes
0answers
209 views

how to take affect the seting on temporary files ( /tmp )

subject - new settings retarding temporary files ( redhat 7.2 ) we set new values on the following configuration files , in order to minimize /tmp capacity in file: /lib/systemd/system/systemd-...
1
vote
2answers
736 views

How to make systemd timer run exactly every 10 minutes, with a task that lasts slightly longer than that?

I have a rather annoying issue with systemd timers and drifting start time. I had an old cron.d script (which executed faithfully once every 10 minutes) that I'm trying to modernize. The problem is ...
1
vote
1answer
181 views

How to stop a service before executing an ExecStart entry?

I would like to set up a Timer which will stop a service, execute a script and restart the service. One of the possibilities is to use Type=oneshot ExecStartPre=/bin/systemctl stop myservice ...
3
votes
0answers
59 views

Prevent systemd timer to run on a metered connection

I have a systemd timer that runs every 10 minutes to download my email with offlineimap. The problem is that i sometimes get a big amount of mail, or big attachments, and in the meantime i might be ...
1
vote
3answers
459 views

restart systemd service within a timeframe

I have systemd unit file, I know it can be restarted on failure by providing parameters, like : Restart=always RestartSec=90 It will restart after 90 seconds whenever it fails, But, I want to ...
1
vote
1answer
56 views

temporarily override one of two complementary timers

In order to toggle light and dark color schemes, I've set up two units that run a script that creates a symbolic link to my termite configuration file, when triggered by their respective timers. The ...
5
votes
1answer
944 views

Cannot override systemd timer with specific time [duplicate]

I use systemd-cron which creates unit files under /lib/systemd. The unit file for cron-daily.timer has [Timer] OnCalendar=daily This triggers the scripts at midnight. I want them to trigger at 3am ...
3
votes
1answer
880 views

systemd timer - how to get history of when timer triggered

systemctl status mytimer.timer Tells me since when it is active and when the next trigger is due. How can I get a list of when the timer triggered in the past?
0
votes
1answer
64 views

Systemd timer run on XX:50

I'm having hard time figure out the format to run every hour on the :50 minute mark. I've tried: OnCalendar=00/0:50 But it Timer unit lacks value setting. Refusing.
1
vote
0answers
128 views

Systemd user timer only runs when logged in [duplicate]

I have as file sync script I want executed periodically every 1 min or so. Since I may need separate instances for different users I run it as a user instead of root. The issue I have is that it seems ...
3
votes
2answers
676 views

Temporarily stop all systemd timer units

I am writing a script that prepares my Linux system for benchmarking. Among other things I want to stop all systemd timer units, and revert this action afterwards. In short, I need the equivalent of ...
1
vote
1answer
256 views

Send email periodically with systemd

I'd like to use systemd timers to send emails periodically to remind me of certain things like anniversaries or filing taxes. I send my regular emails with Mutt; it would be nice if I could reuse ...
1
vote
2answers
1k views

timer with multiple oncalendar moments

I'm using a systemd timer and unit to automatically trigger a backup job. But currently it runs only at one moment in the evening. Is it possible to have it run at multiple moments by declaring it in ...
1
vote
1answer
626 views

Using systemd timer to shut down and start service

I have created a ServiceName.service file. [Unit] Description=ServiceName Service After=network.target [Service] ExecStart=/usr/local/bin/<scriptName>.sh And I have create a ServiceName.timer ...
3
votes
1answer
2k views

How to edit the timer for systemd-tmpfiles-clean?

I'm trying to change the cleanup interval for Apache PrivateTmp files from the default 30 days to 6 hours. I read that to edit the time intervals, I should set up an override file in /etc/tmpfiles.d/...
3
votes
1answer
594 views

Scheduled bash script using systemd timer

I wanted to change my wallpaper periodically and randomly from a folder with pictures. I used the program "feh" and wrote a little script with bash called wallpaperscript.sh: #!/bin/bash files=(/...
0
votes
1answer
460 views

Use systemd-shutdownd schedule

I have multiple Redhat & CentOS 7 servers that are used only during working hours. I am looking into using the systemd-shutdownd service to shut down each machine at 6-30pm on workdays. Systemd ...
3
votes
2answers
2k views

Systemd Timer every minute on specific hours (using a range of values)

I want a script to run minutely, but stop executing it during the nighttime. I tried OnCalendar=*-*-* 05..00:*:00 but that lead to Failed to parse calendar specification, ignoring: *-*-* 05..00:*:...
1
vote
1answer
279 views

Start service on timer start and each N seconds after

I use OnUnitActive property which will run each N secods using last activation time of service as starting point, but i want it always run once when timer started and use 'OnUnitActive' property after....
5
votes
1answer
3k views

I'm writing a systemd timer. What value should I use for WantedBy?

In various examples, I have seen all of these different choices suggested: WantedBy=timers.target WantedBy=multi-user.target WantedBy=basic.target WantedBy=default.target WantedBy=mytimer.target (...
0
votes
2answers
150 views

How to schedule a job as non-root user in CoreOS

I have a script on my CoreOS machine which look like below, that I am using to ssh to multiple nodes from a list and get required details host_det=$(ssh -Ao StrictHostKeyChecking=no -o BatchMode=yes -...
1
vote
1answer
78 views

How to use systemd special units

I was trying to create a simple(ish) way to detect whether my laptop lid was closed and activate i3lock when it is. I know that this can be done through acpid or other methods, but I wanted to learn ...
0
votes
1answer
557 views

Systemd timer starts using 90% CPU randomly

My laptop doesn't send ACPI discharge events reliably, so I created a Systemd timer and service to periodically poll the battery level and decide if the computer should hibernate. However, some random ...
3
votes
1answer
5k views

systemd timer every 2 hours at 30 minutes past the hour?

There are several good references on systemd timers including this one: systemd.time Unfortunately, it still isn't clear to me how to create a timer that will run periodically, but at a specific ...
4
votes
1answer
292 views

systemd: How to run a job both periodically and once at system shutdown?

I want to run a job periodically (e.g., every 5 minutes), and finally once at system shutdown. Systemd supports timers, which could be used to run a job periodically. It also supports to run a job at ...