Cron Expression: Every 1 Hour, Monday to Friday

I am trying to schedule with cron expression 0 */1 * * 1-5(every 1 hour monday to friday) it is not working. I couldn’t see anything after scheduling

Hello @balazubacs,

Please, try with the following cron expression: 0 0 0/1 ? * 1-5 *

Note that you can use this: http://www.cronmaker.com/ to generate any crone that you need.

Best regards,
Susana

1 Like

The expression should be made up of 6 parts (7 if you are including the year), so you are missing the seconds in the beginning.

  • seconds [Mandatory]
  • minutes [Mandatory]
  • hours [Mandatory]
  • day of the month [Mandatory]
  • month [Mandatory]
  • day of the week [Mandatory]
  • year [optional]

The other thing to note is the hours could be written in a couple ways *, */1 both indicate Every Hour, or as Susana indicated 0/1 would technically be every 1 hour starting at midnight

The last piece is the days of the week 1-5 would be Sunday to Thursday, so you would want to use 2-6 or MON-FRI

0 0 0/1 ? * 2-6 *

or

0 0 * ? * MON-FRI *

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.