Created
May 31, 2015 16:39
-
-
Save lucianosousa/e6d8353ce0abe38f6ae1 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