You are not logged in.
Pages: 1
Hello,
I'm going to replace cronie with systemd timers, but for my knowledge I stumble upon the way to prepare a rule that should run on every 20 minutes from midnight to 9:00 AM every days.
the crontab would be something like
*/20 0-9 * * * root myjob
Any example ?
do it good first, it will be faster than do it twice the saint
Offline
"To stumble upon something" means to (accidentally) discover it, which would mean you now have the knowledge. But if you want to figure out how to specify timer events for this job, that's pretty straightforward.
Read `man systemd.timer`.
Learn that you should use OnCalendar and that the syntax for calendar events is explained in systemd.time(7).
Check `man systemd.time` to learn about calendar events (includes examples, but don't skip the syntax description).
If you still get stuck, you'll at least have put in some effort and you can report back here.
Offline
I think OP wanted to say 'stumble over' i.e. trip over, to have problems with, not 'stumble upon'.
See also https://wiki.archlinux.org/index.php/Sy … ctionality for some examples.
Offline
OK, English still a steep learning curve
Thanks both for the attention, unfortunately I didn't find a clear explanation for both reading, that I've done before posting.
Am I right, if I'll set like this?
[Unit]
Description=foo timer
[Timer]
# Y-M-D HH:MM:SS
OnCalendar= *-*-* 0-9:00,20,40:00
# range also permitted ?
Persistent=true
Unit=foo.service
[Install]
WantedBy=basic.target
Will it run every 20 minutes from 00:00 to 00:90 ?
do it good first, it will be faster than do it twice the saint
Offline
You can't use a “-” range for hours, only “,”.
I suggest you put two OnCalendar entries:
# midnight to 8:40am
OnCalendar=0,1,2,3,4,5,6,7,8:0/20
# and lastly at 9am
OnCalendar=9:0
Offline
Pages: 1