Skip to content

Instantly share code, notes, and snippets.

@gerardc
Created June 20, 2011 11:16
Show Gist options
  • Save gerardc/1035453 to your computer and use it in GitHub Desktop.
Save gerardc/1035453 to your computer and use it in GitHub Desktop.
Example cron job calling rake from within a rails application running on an RVM ruby
*/5 * * * * /usr/local/rvm/bin/rvm-shell 'ruby-1.9.2-p180' -c 'BUNDLE_GEMFILE=$HOME/www/rails_apps/<APP_NAME>/current/Gemfile RAILS_ENV=production bundle exec rake -f $HOME/www/rails_apps/<APP_NAME>/current/Rakefile <TASK_NAME>' > $HOME/www/rails_apps/<APP_NAME>/current/log/<TASK_NAME>_output.log 2>$HOME/www/rails_apps/<APP_NAME>/current/log/<TASK_NAME>_error.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment