【发布时间】:2011-07-13 09:51:40
【问题描述】:
在我的日程安排中:
every 10.minutes do
runner "Model.method"
end
每当在我的 crontabs 中创建它时
0,10,20,30,40,50 * * * * /bin/bash -l -c 'cd /home/projects/Monitoring && script/rails runner -e development '\''Model.method'\'''
我尝试在我的控制台中运行该命令并且它有效。为什么它不能自动工作,我要疯了!
在我的系统日志中
Mar 11 11:38:01 UbuntuRails CRON[20050]: (ruben) CMD (/bin/bash -l -c 'cd /home/projects/Monitoring && script/rails runner -e development '\''Ping.check_pings'\''')
Mar 11 11:38:01 UbuntuRails CRON[20048]: (CRON) info (No MTA installed, discarding output)
Mar 11 11:38:01 UbuntuRails CRON[20047]: (CRON) error (grandchild #20050 failed with exit status 1)
Mar 11 11:38:01 UbuntuRails CRON[20047]: (CRON) info (No MTA installed, discarding output)
【问题讨论】:
-
你有本地运行的 cron 吗?您还可以在 schedule.rb 中添加
set :output, File.join(path, 'log', 'cron.log')以记录输出。
标签: ruby-on-rails ubuntu cron crontab whenever