cron - Run a job every X days but only between two specific dates and times -


I think the title says all this.

I will run a job as on June 19, 2014 (say at 7 o'clock), ends on December 25, 2015 (say 11 o'clock), and between these two dates every nine days is. I can set it to work without an end date But I do not know how to include all this in one expression.

Update: Adding to endat () to trigger builder ?

  mytrigger = (ICronTrigger) TriggerBuilder.Create (). With the reputation (Triggers, Name, Trigger Group). With cronShedledible (cron). Endtext (xxxx). Dam ();  

You are in the right direction, schedules require a lot of research The expression can be easily generated through the API, for example, you want the trigger to be the following:

  var startDate = new date time (2014, 06, 19, 7 , 0, 0); Var End date = New date time (2015, 12, 25, 23, 0, 0); Var cronx expression = "0 12 12/9 *? *"; // every nine days itiger trig = Triggerbuilder.Create (). Startdate With CronShedulable (Cron Expression) With the description ("description"). With Identity (that triggers). Prioritize (1). EndAt (endDate). Builder ();  

If you want to see the generated cron expression:

  ICronTrigger trigger = (ICronTrigger) trig; String cronExpression = trigger.CronExpressionString;  

Comments