Last active
August 29, 2015 14:04
-
-
Save addywaddy/2644f28f1e3c05b7e317 to your computer and use it in GitHub Desktop.
Whenever and Rbenv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# As cron runs with a restricted environment, we need to provide it with the correct path for our ruby | |
# Define the following jobs: | |
job_type :rbenv_rake, %Q{export PATH=/usr/local/rbenv/shims:/usr/local/rbenv/bin:$PATH; eval "$(rbenv init -)"; \ | |
cd :path && RAILS_ENV=:environment bundle exec rake :task --silent :output } | |
job_type :rbenv_runner, %Q{export PATH=/usr/local/rbenv/shims:/usr/local/rbenv/bin:$PATH; eval "$(rbenv init -)"; \ | |
cd :path && bundle exec rails runner -e :environment ':task' :output } | |
# And then use them in your schedule | |
every :day, at: '2am' do | |
rbenv_rake 'report:generate' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment