How often would you like the rule to be triggered between 8:30 and 10:30? This will trigger the rule every 5 minutes:
rule "name of the rule"
when
Time cron "0 30/5 8 ? * MON-FRI" // 30/5 means every 5 minutes starting at 30 minutes after the hour
or
Time cron "0 0/5 9 ? * MON-FRI"
or
Time cron "0 0-30/5 10 ? * MON-FRI" // 0-30/5 means every 5 minutes during the interval of 0 to 30 minutes after the hour
then
...
end
@ Thomas: Sorry for the typo … of course I meant “Time” not “Timer”
@ Scott: Thanks for this guidance! For cron this is definitely the reasonable way (… and I must admit that I would have not come up with that idea on my own). Hence “Thanks for sharing” !!!
I thought that there might be a more elegant way that I did not realize
I will try this - THANK YOU!
I have a similar requirement and want to trigger a rule every 8 minutes between 16h (4 pm) and 23h (11 pm). Therefore I created the following cron statement:
rule “XYZ”
when
Time cron “0 */8 16-23 * * ?”
then
…
However, according to the logs the rule is also triggered after 23h which is not the intended behavior. Is 23 h inclusive, i.e., meaning until 23.59?
By giving the time interval from 16-23 it includes to run your rule also at 23:00, 23:08, 23:16, 23:32, 23:40, 23:48 and 23:56. if you don’t want to have the rule to be run after 23h you have to change your cron entry to “16-22”.
You could configure a specific time of day Zone for the timespan you want the rule to be active and set up the Cron to the Intervall you need during the timespan.