#!/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
转载于:https://blog.51cto.com/coolsky/1240427