Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luisdaher/1b3552c50283c9ed2e466423803711f7 to your computer and use it in GitHub Desktop.
Save luisdaher/1b3552c50283c9ed2e466423803711f7 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