Created
March 18, 2011 14:44
-
-
Save leejones/876182 to your computer and use it in GitHub Desktop.
Find passenger processes that have gone off the tracks
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/sh | |
current_datetime=$(date | date +'%F-%H%M') | |
ps aux | grep current | grep -v grep | awk '{print $2}' > /tmp/passengers.$current_datetime.txt | |
passenger-status | grep PID | awk '{print $2}' >> /tmp/passengers.$current_datetime.txt | |
likely_freeloaders=$(uniq -u /tmp/passengers.$current_datetime.txt) | |
echo "Passenger doesn't know if these guys should be on the train" | |
echo $likely_freeloaders | xargs ps -o pid,command --no-headers |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment