日志文件大小触发清理文件日志,并保持正常的日志输出;
# weblogic 日志文件大小触发清理文件日志,并保持正常的日志输出;
#!/bin/bash
# clean the nohup.out file of domain# author by:guoqian
# date:2018-06-19
path="/home/weblogic/Oracle/Middleware/user_projects/domains/domain/bin"
if [ $# -eq 0 ];then
cd $path
file_size=`du -sm nohup.out| awk '{print $1}'`
if [ $file_size -ge 2000 ];then
/bin/cp /dev/null nohup.out
echo "$(date +%F' '%X) :The file size $file_size M , clean it over!" >> $path/clean_nohup.out.log
else
echo "$(date +%F' '%X) :The file size $file_size M , not clean it !" >> $path/clean_nohup.out.log
fi
else
echo "Don't take parameters !"
#深度学习#