Skip to content

Instantly share code, notes, and snippets.

@lucianosousa
Created May 31, 2015 16:39
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save lucianosousa/e6d8353ce0abe38f6ae1 to your computer and use it in GitHub Desktop.
Save lucianosousa/e6d8353ce0abe38f6ae1 to your computer and use it in GitHub Desktop.
check if sidekiq is running
#!/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