listener.log监听日志定期清理脚本
#################listener log#!/bin/bash#---------------------#listener.log about 100m every 8 month,listener.xml about 200m every month#---------------------cd $ORACLE_BASE/diag/tnslsnr/`hostname`/listener/traceexport SIZE=`du -m listener.log | cut -f1`if [ $SIZE -ge 100 ]; then# lsnrctl set log_status off# mv listener.log /oracle/rmanbackup/oracle_log/listener/listener_`date +%Y%m%d%H%M%S`.log cp listener.log /oracle/rmanbackup/oracle_log/listener/listener_`date +%Y%m%d%H%M%S`.log truncate -s 0 listener.log# lsnrctl set log_status onficd $ORACLE_BASE/diag/tnslsnr/`hostname`/listener_orcl/alertfind . -mtime +30 -name "log_*.xml" | xargs rm -rf
#################listener log#!/bin/bash#---------------------#listener.log about 100m every 8 month,listener.xml about 200m every month#---------------------cd $ORACLE_BASE/diag/tnslsnr/`hostname`/listener/traceexport SIZE=`du -m listener.log | cut -f1`if [ $SIZE -ge 100 ]; then# lsnrctl set log_status off# mv listener.log /oracle/rmanbackup/oracle_log/listener/listener_`date +%Y%m%d%H%M%S`.log cp listener.log /oracle/rmanbackup/oracle_log/listener/listener_`date +%Y%m%d%H%M%S`.log truncate -s 0 listener.log# lsnrctl set log_status onficd $ORACLE_BASE/diag/tnslsnr/`hostname`/listener_orcl/alertfind . -mtime +30 -name "log_*.xml" | xargs rm -rf