Reputation: 716
I want to run a schedule on thursday 12:00 a.m. every week how to write the cron?
Upvotes: 1
Views: 1237
Reputation: 281
In this case, you would want the Cron.Weekly(DayOfWeek, Hour).
The IRecurringJobManager interface has a method for adding or updating your tasks (AddOrUpdate
). That method contains an argument for specifying a timeframe.
If you're using a startup project, you would add your task like so:
fooJobManager.AddOrUpdate("TaskName", exampleFunctionToRun, Cron.Weekly(DayOfWeek.Thursday, 0));
Upvotes: 3
Reputation: 2916
I believe that this is the expression that you want: 0 12 */7 * 4
It is representing `min hour day month day-of-week'.
Upvotes: 0