Writing a Single Cron Expression for a Schedule Spanning Past Midnight

0

Hello. I've been working on scheduling a Task in ECS and wrote the following cron expression: cron(30 18-17/1 ? * SUN *). My intended schedule, based on UTC time, was to have the task run every hour starting from 6:30 PM on Sunday until 5:30 PM the following Monday, resulting in 24 executions starting from Sunday evening.

However, according to CloudWatch, the last execution was at 11:30 PM on Sunday. I'm concerned that if I set the days as SUN-MON, it might undesirably start running again from 6:30 PM on Monday.

I'm unsure whether I should set up two separate tasks for Sunday and Monday or if there's a different way I should write the cron expression.

I'm not very fluent in English, so I used a translator. If my question isn't clear, please let me know in the comments. I'll try to explain in more detail.

junsu
asked 3 months ago151 views
1 Answer
0
Accepted Answer

well, I just enrolled 2 sperated tasks. one is cron(30 18-24/1 ? * SUN *), the other is cron(30 0-17/1 ? * MON *). I hope it helps someone solve issues.

junsu
answered 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions