我使用when gem并在schedule.rb
set :output, {:error => "log/cron_error_log.log", :standard => "log/cron_log.log"}
every '* * * * * ' do
command "puts 'you can use raw cron syntax too'"
end
之后我用命令
更新我的crontabwhenever --update-crontab
并重新启动
sudo service cron restart
并按crontab -l
每当生成任务时开始:/home/haseebahmad/projects/social/config/schedule.rb * * * * * / bin / bash -l -c' put' \''您也可以使用原始cron语法' \'' >> log / cron_log.log 2>>登录/ cron_error_log.log'
每当生成任务时结束:/home/haseebahmad/projects/social/config/schedule.rb
但它没有工作意味着cronjo不起作用。我该怎么测试呢?
答案 0 :(得分:0)
你可以运行你的cron工作, ruby / home / haseebahmad / projects / social / config / schedule