Linux统计根分区使用率

Posted shaohsiung

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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

 

以上是关于Linux统计根分区使用率的主要内容,如果未能解决你的问题,请参考以下文章