I am planning to monitor some values in a system between time intervals. I am implementing quartz scheduler. I wanted to understand how to generate crontab which will have the following attributes:
- Runs between 9:45- 12:30
- Interval - 15 mins
- Weekdays
The closest I was able to get was
0/45 9-12 * * Mon-Fri
which is roughly “At every 0 and 45th minute past the 9, 10, 11 and 12th hour on Mon, Tue, Wed, Thu and Fri.”
I don't think you can use a cron string to set at the same time a minute interval and a minute start / end. For example, you can do this:
to run every 15 minutes between 9 and 12 (11.59) or this
to run at 9.15, 10.15 etc.
What I suggest you is to use more than 1 cron schedule using multiple triggers, as suggested here. Or, even simpler, do not use cron but use the
TriggerBuilderutility.Hope it helps :)