Last active
February 3, 2016 07:25
-
-
Save fdeantoni/8002a3737f20a9c3c45c to your computer and use it in GitHub Desktop.
ps monitoring
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
#!/usr/bin/env bash | |
LOG="/home/allied/ps.log" | |
nohup ./ps_output.sh > ${LOG} 2>&1 & |
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
#!/usr/bin/env bash | |
# Every 10 seconds output ps info sorted by CPU utilization (highest first) | |
while true; do | |
printf "\n>>>> `date` (`date -u '+%Y-%m-%d %H:%M:%S'` UTC):\n"; | |
ps aux --sort -pcpu; | |
sleep 10s; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment