Skip to content

Instantly share code, notes, and snippets.



Last active Feb 2, 2017
What would you like to do?
cronからbundle exec...はsu - <USER> -lc ...が一番便利 ref:
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
export PATH=$HOME/local/ruby-2.1/bin:$PATH
0 */1 * * * root su - <USER_NAME> -lc "cd /home/<USER_NAME>/yourproject_path && bundle exec ruby hoge.rb" >> /var/log/yourproject/cron/hoge.log 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.