Advertisement
Guest User

New memthread script

a guest
Aug 26th, 2014
336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.39 KB | None | 0 0
  1. #!/bin/bash
  2. #file contains the output of: pstree mysql -a -p |awk '{print $1;}' | sed 's/|-{mysqld},//' >> psadd
  3. filename='psadd'
  4. #total= '0'
  5. echo Start
  6. while read p; do
  7.     memU=`ps -o rss= -p $p | awk '{print $1*4, "KiB"}'`
  8.     echo "Process ID:"$p  "Memory Usage:"$memU
  9. #total="$((total+memU))"
  10. #echo "This is the current running total:" $total
  11. done < $filename
  12. #echo "Total=" $total
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement