如何每隔5分钟在8-11 AM之间安排每天的任务?什么是配置条目?
答案 0 :(得分:1)
您还可以使用Quartz Scheduler DailyTimeIntervalScheduleBuilder类:
Trigger trigger = (Trigger) newTrigger().withSchedule(DailyTimeIntervalScheduleBuilder.dailyTimeIntervalSchedule().startingDailyAt(new TimeOfDay(8,0)).endingDailyAt(new TimeOfDay(11,0)).withInterval(5, IntervalUnit.MINUTE));
答案 1 :(得分:1)
答案 2 :(得分:0)
如果我正确理解你的要求,你可以在你的crontab中创建一个如下所示的行:
0,5,10,15,20,25,30,35,40,45,50,55 8,9,10 * * * 命令执行你想做的事 < / p>
希望有所帮助!
这里是another source of information解释crontabs -
http://www.thegeekstuff.com/2009/06/15-practical-crontab-examples/
答案 3 :(得分:0)
ITrigger trigger = TriggerBuilder.Create()
.WithIdentity("trigger1")
.StartNow()
.WithSchedule(
DailyTimeIntervalScheduleBuilder.Create()
.StartingDailyAt(TimeOfDay.HourAndMinuteOfDay(8,0)).EndingDailyAt(TimeOfDay.HourAndMinuteOfDay(10,0)))
.Build();