Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- while true
- do
- echo "-------`date`--------"
- echo "tt%MEMt%CPU"
- ps ax -o comm,%mem,%cpu | sort -nk3 | tail -n 3
- sleep 30
- done
- $ ./monitor.sh
- -------Mon Feb 4 20:00:51 CET 2013--------
- %MEM %CPU
- java 9.1 3.6
- Xorg 3.3 4.9
- firefox 8.1 12.2
- ---
- Xorg 3.3 4.9
- firefox 8.1 12.2
- java 9.1 3.6
- chmod 744 monitor.sh
- ./monitor.sh > usage.log &
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement