With OnCalendar
systemd timer i can create something like this to run every 5 minutes.
OnCalendar=*:0/5
Is it possible to run it at every minute ending at 5 (00:05, 00:15, 00:25...) only?
And/or at every minute ending with a 0 (00:00, 00:10, 00:20...) only?
Main goal is to have a timer on 2 server, so each one runs at spare times; in case one fails, the other will at least run every 10 minutes (instead of 5).
I am not sure if this varies from distro to distro. In any case, I am using RHEL8. Try this:
Use the
systemctl daemon-reload
command to make sure that systemd is aware of the changes.Note: You should not edit files under the /usr/lib/systemd directory. With systemd, you can copy the unit file to the /etc/systemd/system directory and edit that copy.
Solution:
which is equivalent to
*:5,15,25,35,45,55
.To be sure of the result, use something like: