Collin Bell
Collin Bell

Reputation: 384

AWS cron jobs to run every minute across a span of time across two hours?

I have a Lambda function on AWS scheduled using the following cron expression:

* 19-20 ? * SAT *

So it runs every minute from 19:00 - 20:59 on Saturdays. In reality, though, it really just needs to run from 19:50 - 20:30 on Saturdays, and my current setup is costing me money for no good reason. Is there any way to specify that with a cron expression (or is there another AWS scheduling mechanism I could use to accomplish this)?

Upvotes: 2

Views: 598

Answers (1)

Marcin
Marcin

Reputation: 238189

I think you have to split it to two expressions:

From 19:50-19:59:

50/1 19 ? * SAT *

From 20:00-20:30:

0-30/1 20 ? * SAT *

Upvotes: 4

Related Questions