Skip to content

Instantly share code, notes, and snippets.

@ArthurN
Created August 24, 2015 18:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ArthurN/b1df9f3738c50f05f3b3 to your computer and use it in GitHub Desktop.
Save ArthurN/b1df9f3738c50f05f3b3 to your computer and use it in GitHub Desktop.
Kill Duplicate Sidekiq processes
#!/bin/bash
if [ $(pgrep -f sidekiq | wc -l) -gt 1 ]; then
kill $(pgrep -f sidekiq | grep -v $(pgrep -of sidekiq) | sort -n | uniq | awk '{printf $1" "}');
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment