Reputation: 253
I have a requirement to run a job on every day night from 1am to morning 6am for every 1 hour. By using online cron makers i formed one cron expression 0 0/59 1-6 ? * * * with this cron expression job is starting at 1am but it is not stopped at 6am after 6am also it is running.I am using Quartz scheduler.
Can any one suggest me the correct cron expression to fulfill my requirement.
Thanks in advance!!!!
Upvotes: 1
Views: 1924
Reputation: 7273
0 0/59 1-6 ? * * *
means: starting at 1:00:00 run this job every 59 minutes each hour (that would be twice, at :00 and :59), up until 6:59:00.
Meanwhile, 0 0 1-6 ? * * *
means exactly: starting at 1:00:00 run this job every hour o'clock up until 6:00:00.
Upvotes: 2