- Example
~/.bash_profile
:[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile export RBENV_ROOT="${HOME}/.rbenv" if [ -d "${RBENV_ROOT}" ]; then export PATH="${RBENV_ROOT}/bin:${RBENV_ROOT}/plugins/ruby-build/bin:${PATH}" eval "$(rbenv init -)" fi export RAILS_ENV=production
- Scheduled cron tasks don't recognize
~/.bashrc
, so put special exports etc into~/.bash_profile
so that you can have rbenv built rubies in your cron jobs.
-
It does
bash -l -c
by default, so it will work with the above combination. -
Custom command definition for running commands within the release directory (e.g., Backup):
job_type :command_wthin_path, 'cd :path && :environment_variable=:environment :task :output' every :day, at: '04:00' do # noinspection RubyResolve command_wthin_path 'backup perform -c backup/config.rb --trigger postgres', output: 'backup/log/backup.log' end