Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- while :; do
- stats=$(passenger-memory-stats | grep Rack)
- if [ "$stats" != "" ]; then
- echo $stats
- echo $stats | egrep --color=always 'MB ([12][0-9]|[3-9])..\.. MB'
- pid=$(echo $stats | egrep 'MB ([12][0-9]|[3-9])..\.. MB' | awk '{ print $1 }')
- if [ "$pid" != "" ]; then
- ps aux | grep $pid
- kill $pid && echo "$pid killed."
- fi
- echo "---"
- fi
- sleep 0.5
- done
Add Comment
Please, Sign In to add comment