Skip to content

Instantly share code, notes, and snippets.

# encoding: utf-8
##
# Backup Generated: cartridgeshop_backup
# Once configured, you can run the backup with the following command:
#
# $ backup perform -t cartridgeshop_backup [-c <path_to_configuration_file>]
#
# For more information about Backup's components, see the documentation at:
# http://backup.github.io/backup
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
### Unicorn ###
check process unicorn
with pidfile "/home/deployer/QA-sample/shared/tmp/pids/unicorn.pid"
start program = "/bin/su - deployer -c 'cd /home/deployer/QA-sample/current && RAILS_ENV=production /home/deployer/.rvm/bin/rvm default do bundle exec unicorn -c /home/deployer/QA-sample/current/config/unicorn/production.rb -E deployment -D'"
stop program = "/usr/bin/env kill -s QUIT `cat /home/deployer/QA-sample/current/tmp/pids/unicorn.pid"
if memory usage > 90% for 3 cycles then restart
if cpu > 90% for 2 cycles then restart
if 5 restarts within 5 cycles then timeout
### Nginx ###