Rake Cron工作错误 [英] Rake Cron job error
问题描述
0/5 * * * * / bin / bash -l -c'cd / home / mss / ruby / example && RAILS_ENV = development / usr / local / bin / bundle exec rake check_me_out --silent >> /tmp/cron_log.log 2>&1'
上面的cron引发错误bash:bundle:command not found ... p>
命令在命令行下可以正常工作
任何帮助都会感激。
好,所以我得到这个工作。 Cron不加载配置文件设置。我必须加载bash_profile作为命令的一部分,现在它可以工作。
0/5 * * * * / bin / bash -l -c 'source〜/ .bash_profile && cd / home / mss / ruby / example && RAILS_ENV = development bin / rake check_me_out --silent >> /tmp/cron_log.log 2>&1'
0/5 * * * * /bin/bash -l -c 'cd /home/mss/ruby/example && RAILS_ENV=development /usr/local/bin/bundle exec rake check_me_out --silent >> /tmp/cron_log.log 2>&1'
Above cron throws an error "bash: bundle: command not found..."
The command works just fine from the command line
Any help will be appreciated.
Okay so I got this working. Cron does not load the profile settings. I had to load the bash_profile as part of the commands and now it works.
0/5 * * * * /bin/bash -l -c 'source ~/.bash_profile && cd /home/mss/ruby/example && RAILS_ENV=development bin/rake check_me_out --silent >> /tmp/cron_log.log 2>&1'
这篇关于Rake Cron工作错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!