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
已提问 4 个月前170 查看次数
1 回答
0
已接受的回答

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
已回答 3 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则