Skip to content

Instantly share code, notes, and snippets.

@kazuph
Created July 16, 2014 10:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kazuph/c78facaec095759aaf8e to your computer and use it in GitHub Desktop.
Save kazuph/c78facaec095759aaf8e to your computer and use it in GitHub Desktop.
cronをシンボリックリンクにしている場合にcapistranoで権限変更をしたい ref: http://qiita.com/kazuph/items/982257cef2424634f459
+set :pty, true
ln -s /home/your_username/your_project_name/current/misc/cron/sample /etc/cron.d/sample
APP_DIR=/home/your_username/your_project_name/current
LOG_DIR=/var/log/your_project_name/cron
# 毎週火曜10:00に実行
00 10 * * 2 root su your_username -l -c "cd ${APP_DIR} && bundle exec rake sample:run RAILS_ENV=production" >> ${LOG_DIR}/sample.log 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment