morfindel
morfindel

Reputation: 132

Cron for AWS - Run every hour except between 10:30 and 12:30 on tuesdays

I have a Glue job that runs at the beginning of every hour. The Cron expression for the trigger looks like this cron(0 * * * ? *).

However, for an two hours on every tuesdays, the destination redshift cluster goes down during it's maintenance window, And I'd rather not run the job then.

How do I specify the cron expression for "Run on the 0th minute of every hour everyday except between 10:30 and 12:30 on Tuesdays"?

Thanks

Upvotes: 2

Views: 2340

Answers (1)

Banjo Obayomi
Banjo Obayomi

Reputation: 1690

Might have to just have two cronjobs one for tuesday, and one for other days

Tuesday: (0 0-10,13-23 * * 2) https://crontab.guru/#0_0-10,13-23___2

Other days: (0 * * * 0-1,3-7) https://crontab.guru/#0___*_0-1,3-7

Upvotes: 2

Related Questions