Created
August 24, 2015 18:51
-
-
Save ArthurN/b1df9f3738c50f05f3b3 to your computer and use it in GitHub Desktop.
Kill Duplicate Sidekiq processes
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 | |
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