Monday, March 9, 2015

delete trace files and logs cron job

00 22 * * * find /opt/app/oracle -name '*.trc' -mtime +20 -exec rm {} \; > /export/home/oracle/logs/clean_up.log 2>&1
10 22 * * * find /opt/app/oracle -name '*.aud' -mtime +20 -exec rm {} \; >> /export/home/oracle/logs/clean_up.log 2>&1
25 22 * * * find /opt/app/oracle -name '*.trm' -mtime +20 -exec rm {} \; >> /export/home/oracle/logs/clean_up.log 2>&1
#         Clean sqlnet trace files
0 5 * * * /usr/bin/find /opt/app/oracle/product/10.2.0.5/network/trace -name 'sql_trace_*.trc' -mtime +1 -exec rm {} \;;


find /export/home/oracle/ -name '*.bab' -mtime +7 -exec mv {} /ora_share_nfs/hhh/hhh/tracefiles/ \;

find /export/home/oracle/ -name '*.bab' -mtime +7 -exec mv "{}" /destination/directory/ \;

00 22 * * * find /u01/app/oracle -name '*.trc' -mtime +20 -exec rm {} \;
10 22 * * * find /u01/app/oracle -name '*.aud' -mtime +20 -exec rm {} \;
20 22 * * * find /u01/app/oracle -name '*.log' -mtime +30 -exec rm {} \;
00 22 * * * find /u01/app/oracle -name '*.trm' -mtime +20 -exec rm {} \;
00 22 * * * find /u01/app/ -name 'log_*.xml' -mtime +20 -exec rm {} \;
00 22 * * * find /home/oracle/sv/logs/ -name '*.out' -mtime +20 -exec rm {} \;
00 22 * * * find /u01/app/11.2.0.4/grid/log/diag/tnslsnr/ -name 'log_*.xml' -mtime +10 -exec rm {} \;


No comments:

Post a Comment

Featured Post

Apply Patch 22191577 latest GI PSU to RAC and DB homes using Opatch auto or manual steps

Patch 22191577: GRID INFRASTRUCTURE PATCH SET UPDATE 11.2.0.4.160119 (JAN2016) Unzip the patch 22191577 Unzip latest Opatch Version in or...