Skip to content

Instantly share code, notes, and snippets.

@nowthatsamatt
Created May 17, 2012 16:47
Show Gist options
  • Select an option

  • Save nowthatsamatt/2720114 to your computer and use it in GitHub Desktop.

Select an option

Save nowthatsamatt/2720114 to your computer and use it in GitHub Desktop.
#!/bin/bash
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/ruby/bin"
import_script_news=`ps -ef|grep -c [i]mport_script_news.rb`
if [ $import_script_news -lt 1 ]; then
echo "CRITICAL: import_script_news.rb is NOT running."
cd /srv/news/current && RAILS_ENV=production nohup bundle exec rails runner extras/import_script_news.rb >> /srv/service_logs/import_script_news.log &
exit 2
fi
echo "OK: All import scripts are running."
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment