id=`ls -t|grep mysql-bin.0|wc -l`
echo $id
if [[ $id -gt 50 ]];then
ls -t |grep mysql-bin.0|tail -n $(($id-50))| xargs rm -rf
fi
转载于:https://blog.51cto.com/3177002/1717455
id=`ls -t|grep mysql-bin.0|wc -l`
echo $id
if [[ $id -gt 50 ]];then
ls -t |grep mysql-bin.0|tail -n $(($id-50))| xargs rm -rf
fi
转载于:https://blog.51cto.com/3177002/1717455