【发布时间】:2011-05-30 02:44:31
【问题描述】:
我正在尝试将 appengine 任务设置为在每天、每周、每月和每年的午夜重复,以清除游戏的高分列表。
我的 cron.yaml 看起来像这样:
- description: daily clear
url: /delete?off=10
schedule: every day 00:00
- description: weekly clear
url: /delete?off=20
schedule: every monday 00:00
- description: monthly clear
url: /delete?off=30
schedule: every month 00:00
- description: yearly clear
url: /delete?off=40
schedule: every year 00:00
每天和每周的工作都可以,但我不知道如何让工作每月和每年重复一次。这是the schedule format。
对于每个月的工作,我都尝试过“每个月”、“每月 1 日”等表达方式,但没有任何效果。这种类型的计划是否可以在 cron 作业中使用?
或者我是否需要只在每天 00:00 调用清算页面,并在页面中执行此逻辑并测试当前日期(如果它是周/月/年的开始)?
【问题讨论】:
-
如果它每天重复,它也会每周、每月、每季度和每年重复。它还会重复每个满月。在“星期日”或每月 1 日进行日常工作检查有什么问题?
-
每周只出现一次。在星期日运行的每周作业每周重复。
-
谢谢,抱歉。每周从星期一开始。
-
+1 不错。为我节省了很多时间来挖掘文档
标签: python google-app-engine cron