a=`free |head -n 2 |tail -n 1 |awk ‘{print $7}‘`
if [ $a -ge 900000 ];then
sync && echo 1 >/proc/sys/vm/drop_caches
else
echo "`date +%x%T` cache: <90000" >> /home/1
fi
b=`vmstat 1 |head -n 4 |tail -n 1 |awk ‘{print $ 13}‘`
if [ $b -ge 90 ];then
echo "cpu >90,restart server----------------" >>/home/1
else
echo "`date +%x%T` cpu:$b" >>/home/1
fi
时间: 2024-11-02 15:20:50