2012-04-13 70 views

回答

1

您還可以使用Quartz調度DailyTimeIntervalScheduleBuilder類:

Trigger trigger = (Trigger) newTrigger().withSchedule(DailyTimeIntervalScheduleBuilder.dailyTimeIntervalSchedule().startingDailyAt(new TimeOfDay(8,0)).endingDailyAt(new TimeOfDay(11,0)).withInterval(5, IntervalUnit.MINUTE)); 
+0

我正在通過配置文件驅動作業調度程序;我正在尋找以下格式:以下格式:0 0 12 1/1 *? *我不是通過代碼設置作業調度程序... – Ocean 2012-04-13 19:19:25

+0

謝謝@Anthony Dahanne.but此代碼適用於java。 – 2013-05-28 11:01:15

0

如果我理解正確了你的要求,你將創建在crontab一行看起來是這樣的:

0,5,10,15,20,25,30,35,40, 45,50,55 8,9,10 * * * 命令執行你想要做的事

希望有所幫助!

這裏的another source of information解釋的crontab -

http://www.thegeekstuff.com/2009/06/15-practical-crontab-examples/

+0

測試cron表達式我期待在下面的格式:0 0 12 1/1 *? * – Ocean 2012-04-13 18:30:36

+0

啊,好的。我現在看到它被標記爲c#,所以也許你處於M $的領域。我從一個簡單的Linux/UNIX shell/crontab的角度嚴格考慮了這一點。對不起,如果沒有幫助。 – Lobos 2012-04-13 18:37:32

1

0 0/5 9 * * ?

對於如何構建cron的意義,請參見this石英調度程序的表達式。 您還可以通過這個website

0
ITrigger trigger = TriggerBuilder.Create() 
        .WithIdentity("trigger1") 
        .StartNow() 
        .WithSchedule(
        DailyTimeIntervalScheduleBuilder.Create() 
        .StartingDailyAt(TimeOfDay.HourAndMinuteOfDay(8,0)).EndingDailyAt(TimeOfDay.HourAndMinuteOfDay(10,0))) 
         .Build(); 
相關問題