全部博文(33)
2008年(33)
分类:
2008-09-04 14:20:41
#! /sbin/sh -x
bdf |grep /tmp | awk '{print $5}'>PFILE
P=`cat PFILE |wc -c ` //统计该域的字符数数字占1个字符,%占2个字符
if [ $P -eq 4 ]
then
V=`cat PFILE |cut -c1-2`
else
if [ $P -eq 3 ]
then
V=`cat PFILE | cut -c1-1`
else
echo " /tmp already been full
exit
fi
fi
N="90"
if [ $V -gt $N ];then
rm -R /tmp/*
else
echo " /tmp is normal"
fi