如何设置具有初始启动时间的循环 Cron 作业?

How to set a recurring Cron job with an initial starting time?

如何将 Cron 作业设置为无限期地每六小时 6:00 AM (GMT +0) 和 运行 开始? (6:00, 12:00, 18:00, 24:00)

我试过这个:

cron:
- description: Scrape every 6 hours
  url: /api/v1.0/generator
  schedule: every 6 hours synchronized

我不确定如何设置该作业的开始时间。

我在本地环境 (http://localhost:8000/cron) 中看到以下内容:

every 6 hours synchronized
In production, this would run at these times:
2015-02-03 00:00:00Z 0:09:46.785390 from now
2015-02-03 06:00:00Z 6:09:46.785390 from now
2015-02-03 12:00:00Z 12:09:46.785390 from now

这似乎是从凌晨 12 点、早上 6 点、中午 12 点开始,然后就停在那里了?好像不太对。

本地开发服务器没有 运行 cron 作业,它只是向您显示作业在生产中 运行 接下来的几次。

生产安排不会在前几次工作后停止,后续可能有无限次,但显示不能无限次,所以只显示一些。

所以,在你的鞋子里,我不会担心!

WRT如何设置开始时间:在一般语法中,给出为

every N (hours|mins|minutes) ["from" (time) "to" (time)]

具体用途

every 6 hours from 5:58 to 23:59

应该工作 - 是的,它会 运行 每个工作比你想要的早一两分钟,但我正在努力解决“23:59 是一天中的最后一次”限制.