每30s监控磁盘根分区空间大小

#!/bin/bash
while sleep 30s
do
for N in `df -h |grep -w / |awk '{print $4}'|sed 's/%//'`
 do
echo $N
 if [ $N -ge 90 ];then
 echo "The root partion is Low!" |mail -s "disk space warning" root
 fi
done
done


你可能感兴趣的:(监控,sleep,warning,空间)