在您阅读本文之前,请了解我对 cron 的想法完全陌生,所以这对我来说很困难。我每次都捆绑安装了gem。然后我跑了
wheneverize .
没有错误。schedule.rb 已创建。我运行时有一个名为 schedule_scrape.rb 的文件
ruby script/scheduled_scrape.rb
它工作得很好。我把我的 schedule.rb 这些行
every 1.minutes do
command "ruby script/scheduled_scrape.rb" #later on it'll be half an hour,
#i just need to test here
end
这没有任何作用。我四处寻找,发现也许应该在终端中调用它(我想激活它?)
whenever --update-crontab store
现在,这仍然无能为力。我需要做什么才能定期调用我的 schedule_scrape.rb