Forked from lucianosousa/gist:e6d8353ce0abe38f6ae1
Created
September 27, 2016 19:51
-
-
Save luisdaher/1b3552c50283c9ed2e466423803711f7 to your computer and use it in GitHub Desktop.
check if sidekiq is running
This file contains hidden or 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
#!/bin/bash | |
echo "starting check sidekiq" | |
process=`cat /path-to/sidekiq.pid` | |
processConfirmation=`ps aux | awk '{print $2 }' | grep $process` | |
if [ -z $processConfirmation ] | |
then | |
echo "oops! not running... restarting sidekiq" | |
cd /path-to-app/current && bundle exec sidekiq -e production -C config/sidekiq.yml -d -P tmp/pids/sidekiq.pid | |
fi | |
echo "finished sidekiq check" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment