Created
April 20, 2017 23:35
-
-
Save binzram/5de474437b32c9a98058239a3158945a to your computer and use it in GitHub Desktop.
Zombie process catcher
This file contains 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 | |
ps aux | awk '{if ($8 = "Z") print $1,$2,$8,$11;}' | tee /home/$USER/zombie.tmp | |
ZCOUNT=$(wc -l /home/$USER/zombie.tmp | awk '{print $1}') | |
ZCOUNT=$(expr $ZCOUNT - 1) | |
echo "Total $ZCOUNT zombie processes found." | |
rm -f /home/$USER/zombie.tmp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment