Last active
February 2, 2017 09:44
-
-
Save kazuph/29d43e6aa93feb60bb49 to your computer and use it in GitHub Desktop.
cronからbundle exec...はsu - <USER> -lc ...が一番便利 ref: http://qiita.com/kazuph/items/c530359eada5b2639e68
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
export PATH="$HOME/.rbenv/bin:$PATH" | |
eval "$(rbenv init -)" |
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
export PATH=$HOME/local/ruby-2.1/bin:$PATH |
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
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