2012-02-23 70 views
0

我在rails應用程序的ruby中實現了gem。這種寶石生成的配置文件,我有這樣的數據有:Rails 3和crontab - Crontab日誌爲空

配置/ 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 

Everuthing的作品,但我cron_log.log爲空。爲什麼?我該如何解決這個問題?

回答