Script to housekeeping log files
#!/bin/sh
DIR_LIST="/opt/app/oracle/diag/rdbms/$ORACLE_SID/$ORACLE_SID/trace /opt/app/oracle/admin/$ORACLE_SID/adump /opt/app/grid/product/11.2/grid/rdbms/audit /opt/app/grid/diag/asm/+asm/+ASM/trace"
PATTERN="*\.aud || *\.trc"
for DIR in $DIR_LIST
do
filename=$DIR/`date +%Y%m%d`.tar.gz
echo echo $filename
`/usr/bin/find $DIR -iname "*\.aud" -o -iname "*\.trc" -o -iname "*\.trm" -daystart -mtime -31 | xargs tar czPf $filename --remove-files`
done
No comments:
Post a Comment