Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的网站托管在 Heroku 上,我需要每周运行一次任务。调度程序插件只允许我每天运行一次任务......无论如何我可以改变它吗?
我的网站是用 Ruby on Rails 编写的。
检查今天是否是星期一,否则不要运行您的任务。
Time.now.wday => 2
0:星期日.. 6:星期六
或者从调度程序任务中进行相同的检查
test `date +%w` -eq 2 && rake ...
再次 0:星期日 ... 6:星期六