0

I coded a Crontrigger to work for 2 specific days... 14 and 28 of each month. It´s working at the specified time(11:55 pm) but works for every single day :S

// Definimos el job de la clase que hereda de la interfaz iJob
            IJobDetail jobCambioClave = JobBuilder.Create<CambioClave>()
                .WithIdentity(LookupItemsTypes.AyA_Password_Changer, "ClosureGroup")
                .Build();

            ITrigger conTrigger = TriggerBuilder.Create()
                .ForJob(jobCambioClave)
                .WithIdentity("PassWordAyAChangerTrigger", "ClosureGroup")
                .WithCronSchedule("0 55 23 14-28 * ?") 
                .StartNow()
                .Build();

            scheduler.ScheduleJob(jobCambioClave, conTrigger);

            scheduler.Start();

If you have an idea why is this happening please I'll appreciate it, I´ve been testing a lot of expressions for the .WithCronSchedule parameter.

4

1 回答 1

0

You need to use a comma in the day part of the expression to specify range. Like this:

0 55 23 14,28 * ?

Have a look at cronmaker, it is very useful for testing cron expressions.

于 2015-04-16T16:26:30.617 回答