简体   繁体   English

一周仅五天在Google App Engine上进行Cron工作

[英]Cron job on google app engine only five days of a week

I am setting up a cron job app engine, which has to be executed on Mon, Tue, wed, Thu, Fri between some time. 我正在设置一个cron作业应用程序引擎,该引擎必须在一段时间之间的周一,周二,周三,周四,周五执行。

According to Cron job doc i can make a syntax like this, 根据Cron工作文档,我可以编写这样的语法,

every monday, tueday, wednesday, thursday, friday 30 minutes from 9:00 to 15:45 (in schedule tag) 每个星期一,星期二,星期三,星期四,星期五从9:00到15:45的30分钟 (按时间表标记)

can you please validate the same. 你能验证一下吗

Unfortunately, you are only able to specify which days to run on when specifying an exact time to run. 不幸的是,您只能在指定确切的运行时间时指定运行的日期。 You cannot mix intervals and days: https://cloud.google.com/appengine/docs/standard/java/config/cronref#schedule_format 您不能混合间隔和日期: https : //cloud.google.com/appengine/docs/standard/java/config/cronref#schedule_format

What I would do is schedule the cron to run from 9:00 to 15:45 every day like this: 我要做的是安排cron每天从9:00运行到15:45,如下所示:

every 30 minutes from 9:00 to 15:45

And, then add some code in your handler that exits early if it is Saturday or Sunday. 然后,在您的处理程序中添加一些代码,如果它是星期六或星期日,则该代码会提前退出。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM