Coldfusion crontime incorrectly running on weekend

752 views Asked by At

I have a scheduled task that needs to run three times a day, on each weekday. The setup surrounding the task is Coldfusion, and it is in the Crontime format. It should run at 11:30, 15:45 and 18:30 server time.

For some reason the task is occasionally running on weekends, which it should not do.

Here are the three strings for each of the days:

0 30 11 ? * 1-5
0 45 15 ? * 1-5
0 30 18 ? * 1-5

Can anyone point out to me why the task is sometimes running on weekends? Is there a mistake in my string?

The Coldfusion crontime documentation can be found here:

1

There are 1 answers

1
Neokoenig On BEST ANSWER

According to This, 1 = Sunday.

Days-of-Week can be specified as values between 1 and 7 (1 = Sunday) or by using the strings SUN, MON, TUE, WED, THU, FRI and SAT.

Try replacing 1-5 with MON-FRI?

An example of a complete cron-expression is the string "0 0 12 ? * WED" - which means "every Wednesday at 12:00:00 pm".

Individual sub-expressions can contain ranges and/or lists. For example, the day of week field in the previous (which reads "WED") example could be replaced with "MON-FRI", "MON,WED,FRI", or even "MON-WED,SAT".