Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # this script scans the system for processes that do too much IO and changes their priority
- # to keep them from bogging down the rest of the system
- # iotop -o -qqq -k -n 2
- iotop -o -qqq -k -n 2 | awk '{print $1 , $6}' > /run/io_process_list
- #cat /run/io_process_list
- #echo end cat
- file="/run/io_process_list"
- while IFS= read -r line; do
- kilobytes_used=$( echo "$line" | awk '{ print $2 }' | awk -F"." '{ print $1 }' )
- #echo kylobites used are $kilobytes_used
- if [ $kilobytes_used -gt 10000 ] ; then
- ionice -c3 -p$( echo "$line" | awk '{ print $1 }' )
- #echo "$line" | awk '{ print $1 }'
- fi
- #printf '%s\n' "$line"
- done < "$file"
- rm "$file"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement