#/bin/sh
USE=`df -h|grep '/dev/sda1'|awk {'print $5'}|cut -f 1 -d "%"`
#echo $USE
df -h|grep '/dev/sda1'
if [ ${USE} -ge 80 ];then
{
echo "disk used more than $USE,delete log now...."
rm -rf /var/log/mysql/mysql-bin.00000*
rm -rf /var/log/bigworld/message_logger.log*
rm -rf /var/log/bigworld/stat_logger.log*
rm -rf /var/log/bigworld/web_console.log*
echo '########'
df -h|grep '/dev/sda1'
exit
}
fi
~
~
阅读(468) | 评论(0) | 转发(0) |