Linux统计根分区使用率
1 #!/bin/bash 2 3 # 统计根分区使用率 4 # 作者: shaohsiung 5 # 时间: 2018/11/19 6 7 rate=$(df -h | grep "dev/sda3" | awk '{print $5}' | cut -d "%" -f1) 8 9 if [ $rate -ge 80 ] 10 then 11 echo "Root partition usage exceeds 80%, mail has been sent to the administrator..." 12 fi