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

 

posted on 2018-11-19 18:21  ert999  阅读(586)  评论(0编辑  收藏  举报

导航