这个问题可能只有在你了解创造cron工作机会的方法时才有意义.我的日程安排中有一项任务.rb样
every 1.day, :at => '4am' do
command "cd #{RAILS_ROOT} && rake thinking_sphinx:stop RAILS_ENV=#{RAILS_ENV}"
command "cd #{RAILS_ROOT} && rake thinking_sphinx:index RAILS_ENV=#{RAILS_ENV}"
command "cd #{RAILS_ROOT} && rake thinking_sphinx:start RAILS_ENV=#{RAILS_ENV}"
end
然而,当我使用
whenever --update-crontab appname --set environment=production
cron作业(job)仍然有RAILS_ENV=development.我现在在生产和开发方面的任务是一样的,我只需要改变环境变量,因为思考斯芬克斯需要了解当前的环境.有什么办法吗?
谢谢