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/test.sh -a
ExecStop=/usr/local/bin/test.sh -b
[Install]
WantedBy=multi-user.target
And I want to restart it each minute with the following Systemd myscript.timer unit:
[Unit]
Description=Schedule script execution
[Timer]
OnCalendar=*:0/1
[Install]
WantedBy=timers.target
It only works the first time, after it, the status remains in n/a:
# systemctl list-timers
NEXT LEFT LAST PASSED UNIT ACTIVATES
n/a n/a Tue 2019-10-15 14:50:01 EDT 3ms ago myscript.timer myscript.service
~