【发布时间】:2019-07-25 19:43:07
【问题描述】:
我需要在每个星期四的上午 10 点准确地运行一项任务,
在 resque yaml 文件上我正在尝试这个
cron: "* 10 * * 4 * America/New_York" # expecting this to shoot out every thursday..
这是正确的吗?我无法测试它,因为我等不及这样的间隔,所以我尝试至少每 5 分钟测试一次,但它不是很有希望
cron: "5 * * * * *" # It runs for every single minute..
感谢任何帮助或指导。
我关注了这个
* * * * * *
| | | | | |
| | | | | +-- Year (range: 1900-3000)
| | | | +---- Day of the Week (range: 1-7, 1 standing for Monday)
| | | +------ Month of the Year (range: 1-12)
| | +-------- Day of the Month (range: 1-31)
| +---------- Hour (range: 0-23)
+------------ Minute (range: 0-59)
【问题讨论】:
-
这个特定实现的文档允许 6 个字段,但是当使用 6 个字段时,第一个字段表示秒而不是分钟。见github.com/resque/resque-scheduler
标签: ruby-on-rails cron resque