skip to Main Content

I’m trying to get cron expression to trigger an event at 7:45 UTC on only working days — Monday to Friday.

45 7 * * MON,TUE,WED,THU,FRI *
45 7 * * 1,2,3,4,5 *

Although the above expressions were supposed to work I am getting an Invalid CRON expression error raised on both and so how is the day of the week supposed to be to get it to work on only working days?

2

Answers


  1. It should be:

    45 7 ? * MON,TUE,WED,THU,FRI *
    
    Login or Signup to reply.
  2. Could you please try this

    45 7 ? * MON,TUE,WED,THU,FRI *
    45 7 ? * 1,2,3,4,5 *
    

    or

    45 7 ? * MON-FRI *
    45 7 ? * 1-5 *
    

    More examples are available at https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-rule-schedule.html#eb-cron-expressions

    Sri

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search