Google App Engine上的Cron作业语法

时间:2021-02-24 20:21:22

I am trying to schedule a job to run "every 15 minutes on weekdays only" using the Google App Engine cron scheduler (for Java apps). http://code.google.com/appengine/docs/java/config/cron.html#The_Schedule_Format
Does any know what the correct syntax is? I have tried using the xml below, but find that it runs on all days not just the weekdays listed.

我正在尝试使用Google App Engine cron调度程序(针对Java应用程序)安排“仅在工作日每15分钟”运行一项工作。 http://code.google.com/appengine/docs/java/config/cron.html#The_Schedule_Format有没有人知道正确的语法是什么?我尝试使用下面的xml,但发现它运行的所有日子不仅仅是列出的工作日。

<?xml version="1.0" encoding="UTF-8"?>
<cronentries>
  <cron>
    <url>/finance/collect</url>
    <description>Fetch data every 15 minutes</description>
    <schedule>every 15 minutes monday, tuesday, wednesday, thursday, friday</schedule>
  </cron>
</cronentries>

Thanks

3 个解决方案

#1


According to the documentation, once you specify days you can only specify a single absolute time for the task to run.

根据文档,一旦指定天数,您只能为任务指定一个绝对时间。

I suggest you check the day of week in your job and do nothing if it is not a weekday.

我建议你检查你工作中的星期几,如果不是工作日那就什么都不做。

#2


How to config a task to run every 5 minutes between 9:00am~20:00pm, but every 10 minutes in other time of the day.

如何将任务配置为在上午9:00到晚上20:00之间每5分钟运行一次,而在一天中的其他时间每10分钟运行一次。

#3


According to your link it appears the only difference is the fact that you have a space in the schedule tag between the selectors and this example does not:

根据你的链接,看来唯一的区别是你在选择器之间的schedule标签中有一个空格,这个例子没有:

2nd,third mon,wed,thu of march 17:00

#1


According to the documentation, once you specify days you can only specify a single absolute time for the task to run.

根据文档,一旦指定天数,您只能为任务指定一个绝对时间。

I suggest you check the day of week in your job and do nothing if it is not a weekday.

我建议你检查你工作中的星期几,如果不是工作日那就什么都不做。

#2


How to config a task to run every 5 minutes between 9:00am~20:00pm, but every 10 minutes in other time of the day.

如何将任务配置为在上午9:00到晚上20:00之间每5分钟运行一次,而在一天中的其他时间每10分钟运行一次。

#3


According to your link it appears the only difference is the fact that you have a space in the schedule tag between the selectors and this example does not:

根据你的链接,看来唯一的区别是你在选择器之间的schedule标签中有一个空格,这个例子没有:

2nd,third mon,wed,thu of march 17:00