Run script every 30 min with systemd
52
votes
3
answers
87859
views
I would like to execute a script every 30 min after booting into the system. I know you can use cron, but I don't plan to use this feature often therefore I'd like to try it with systemd.
So far I have only found the monotonic timers which allows to execute something once (at least I think so). How would the
foo.timer
and foo@user.service
look like in case I wanted to execute something every 30 minutes from boot/system start?
**foo@user.service**
[Unit]
Description=run foo
Wants=foo.timer
[Service]
User=%I
Type=simple
ExecStart=/bin/bash /home/user/script.sh
**foo.timer**
[Unit]
Description=run foo
[Timer]
where I am stuck... ???
Asked by TomTom
(2743 rep)
Apr 24, 2015, 06:28 PM
Last activity: May 5, 2025, 10:27 PM
Last activity: May 5, 2025, 10:27 PM