无法在开发模式下运行cronjob

时间:2016-10-13 06:22:09

标签: ruby-on-rails whenever

我正在使用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 -isudo service cron restart仍然没有执行cronjob。任何建议都会有所帮助

0 个答案:

没有答案