【问题标题】:Rails 3 and crontab - Crontab log is emptyRails 3 和 crontab - Crontab 日志为空
【发布时间】:2012-02-23 13:45:13
【问题描述】:

我在我的 ruby​​ on rails 应用程序中实现了 gem。这个 gem 生成的配置文件,我有这样的数据:

config/schedule.rb

set :output, "/vol/www/apps/logs/cron_log.log"                                #Log for production.
set :my_path, "/vol/www/apps/ror_tutorial/current"

every 5.minutes do
  command "cd #{my_path} && bundle exec rake thinking_sphinx:index RAILS_ENV=production && bundle exec rake thinking_sphinx:rebuild RAILS_ENV=production && chmod 777 -R #{my_path}/log"
end

所以这会在 crontab 中生成这样的代码:

$ crontab -e

# Begin Whenever generated tasks for: ror_tutorial
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /bin/bash -l -c 'cd /vol/www/apps/ror_tutorial/current && bundle exec rake thinking_sphinx:index RAILS_ENV=production && bundle exec rake thinking_sphinx:rebuild RAILS_ENV=production && chmod 777 -R /vol/www/apps/ror_tutorial/current/log >> /vol/www/apps/logs/cron_log.log 2>&1'

# End Whenever generated tasks for: ror_tutorial

一切正常,但我的 cron_log.log 是空的。为什么?我该如何解决?

【问题讨论】:

    标签: ubuntu ruby-on-rails-3.1 crontab ruby-1.9.3 whenever


    【解决方案1】:

    查看 crond 的启动位置。日志记录级别可能被关闭。 This post here 解释得很好。

    【讨论】:

      猜你喜欢
      • 2017-11-16
      • 1970-01-01
      • 2015-02-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-09-09
      • 2011-03-15
      相关资源
      最近更新 更多