磁盘处理模板脚本!!

#!/bin/bash
monitor_dir=/opt/web/monitor
monitor_file=gateway-monitor-0.0.1-SNAPSHOT.out
file_size=`du -s ${monitor_dir}/${monitor_file} | awk '{print $1}'`
max_size=$((1024*1024*1))
if [ ${file_size} -ge ${max_size} ];then
cat /dev/null > /opt/web/monitor/gateway-monitor-0.0.1-SNAPSHOT.out
fi

 

 

 

 

 

 

 

 

 

 

 &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

安徽磁盘处理模板:

#!/bin/bash
GWS_DIR=/opt/runGWS
file_size=`du -s ${GWS_DIR} | awk '{print $1}'`
max_size=$((1024*1024*3))
if [ ${file_size} -ge ${max_size} ];then
echo " " > ${GWS_DIR}/error.log
rm -rf ${GWS_DIR}/GWS.log.*
fi

 

 

#!/bin/bash
GWS_DIR=/opt/runGWS
file_size=`du -s ${GWS_DIR} | awk '{print $1}'`
max_size=$((1024*1024*3))
if [ ${file_size} -ge ${max_size} ];then
echo " " > ${GWS_DIR}/error.log
rm -rf ${GWS_DIR}/GWS.log.*
[ -f ${GWS_DIR}/core ] && rm ${GWS_DIR}/core
fi

posted @ 2022-09-14 10:08  往事已成昨天  阅读(20)  评论(0编辑  收藏  举报