Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #!/bin/sh
  2. while true
  3. do
  4. echo "-------`date`--------"
  5. echo "tt%MEMt%CPU"
  6. ps ax -o comm,%mem,%cpu | sort -nk3 | tail -n 3
  7. sleep 30
  8. done
  9.  
  10. $ ./monitor.sh
  11. -------Mon Feb 4 20:00:51 CET 2013--------
  12. %MEM %CPU
  13. java 9.1 3.6
  14. Xorg 3.3 4.9
  15. firefox 8.1 12.2
  16. ---
  17. Xorg 3.3 4.9
  18. firefox 8.1 12.2
  19. java 9.1 3.6
  20.  
  21. chmod 744 monitor.sh
  22. ./monitor.sh > usage.log &
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement