我正在使用gem来安排一个小的cron工作。
这是我的schedule.rb
every 1.minute do
rake "send_query:to_dummy", :environment => "development"
end
这是rake任务
namespace :send_query do
task :to_dummy => :environment do
Dummy.create(name: "1234")
end
end
rake任务rake send_query:to_dummy
本身就可以正常工作。但我不能让cronjob工作
每当我输入
时 whenever
* * * * * /bin/bash -l -c 'cd /home/gvpmahesh/code/digifutura/website && RAILS_ENV=development bundle exec rake send_query:to_admins --silent'
* * * * * /bin/bash -l -c 'cd /home/gvpmahesh/code/digifutura/website && RAILS_ENV=development bundle exec rake send_query:to_dummy --silent'
## [message] Above is your schedule file converted to cron syntax; your crontab file was not updated.
## [message] Run `whenever --help' for more options.
我已经尝试了whenever -i
和sudo service cron restart
仍然没有执行cronjob。任何建议都会有所帮助