-1

I need help on a proper cron expression that will fire the job immediately after it's launched, then reoccurring every minutes thereafter. So far I have

0 0/1 * 1/1 * ? *?

But that only fires at the minute mark (i.e. 3:31:00, 3:32:00). So if I launch the job at 3:45:54, I want it to execute right away, then the next fire would be at 3:46:54.

thanks.

Niner
  • 2,074
  • 6
  • 37
  • 47

1 Answers1

2

You cannot do that with a cron expression but you can use SimpleScheduleBuilder using WithSimpleSchedule:

ITrigger trigger = TriggerBuilder
    .Create()
    .WithIdentity("trigger1", "gruppone")
    .StartNow()
    .WithSimpleSchedule(s => s.WithIntervalInMinutes(1).RepeatForever())
    .Build();

and this would be the end result:

27/09/2015 12:28:28 +01:00
27/09/2015 12:29:28 +01:00
27/09/2015 12:30:28 +01:00
27/09/2015 12:31:28 +01:00
27/09/2015 12:32:28 +01:00
27/09/2015 12:33:28 +01:00
LeftyX
  • 35,328
  • 21
  • 132
  • 193