How to make sure job execute only once..

Apr 18, 2012 at 2:44 PM

Hi ,

I have a scenario where i want the job to be executed only once i.e. today at 3 pm and then never repeat again.I am not able to figure out how to do it.

Regards,

Coordinator
Apr 22, 2012 at 4:42 AM

The current version doesn't support year as a scheduling parameter, so you can't technically do it. If you set up a task with every other parameter it will execute once per year; perhaps that's close enough?

Happy to accept a pull request if you want to add it. If you want a task to execute at 2012-04-22 15:00 the fluent config should be:

var s = new Schedule()
    .AtSeconds(0)
    .AtMinutes(0)
    .AtHours(15)
    .AtMonths(4)
    .AtDaysOfMonth(22)
    .AtYears(2012)
    .WithLocalTime()
    .WithName("PrimaryKey")
    .Execute<ConsoleWriteTask>();
Apr 30, 2012 at 2:08 PM

Yes John it would have been appreciated if year option was there..:(

Coordinator
May 1, 2012 at 10:29 PM

I don't have time to add it now but if you can add it, please create a fork and the request that I pull it. Happy to include it in a release if you augment the solution. http://blogs.msdn.com/b/codeplex/archive/2010/03/05/codeplex-mercurial-support-for-forks.aspx