RE: cron job at linux to remove trace and audit files

  • From: Iggy Fernandez <iggy_fernandez@xxxxxxxxxxx>
  • To: "oracle-l@xxxxxxxxxxxxx" <oracle-l@xxxxxxxxxxxxx>
  • Date: Tue, 9 Jun 2015 06:47:30 -0700

You shouldn't be modifying /etc/crontab. Instead use "crontab -e". The explains
why "crontab -l" does not show anything. You should preferably use "crontab -e"
from the oracle account in which case you don't need a user name after the time
fields. Review the following links:
http://unix.stackexchange.com/questions/119481/how-come-crontab-e-is-different-from-less-etc-crontabhttp://serverfault.com/questions/449651/why-is-my-crontab-not-working-and-how-can-i-troubleshoot-it
Also, your "rm" command line is malformed. You probably meant to use "&&"
(command concatentation) not "&" (background mode). Review the following link.
http://unix.stackexchange.com/questions/37069/what-is-the-difference-between-and-when-chaining-commands
Iggy

Date: Tue, 9 Jun 2015 09:17:48 +0000
From: dmarc-noreply@xxxxxxxxxxxxx
To: oracle-l@xxxxxxxxxxxxx
Subject: cron job at linux to remove trace and audit files

Hello professionals,Please I need to set a cron job task to remove all trace
and audit files at database 11g every 5 minutes , platform linux v5I want to
know all the steps needed in order to run successfully because it didn't work
with me.Please find below the steps performed.Thanks
[root@Abohamad trace]# cat /etc/crontab
SHELL=/bin/bashPATH=/sbin:/bin:/usr/sbin:/usr/binMAILTO=rootHOME=/# run-parts01
* * * * root run-parts /etc/cron.hourly02 4 * * * root run-parts
/etc/cron.daily22 4 * * 0 root run-parts /etc/cron.weekly42 4 1 * * root
run-parts /etc/cron.monthly***********************************
00,05,10,15,20,25,30,35,40,45,50,55 * * * * root rm -rf
/opt/oracle/base/diag/rdbms/cdsdb/cdsdb/trace/*.trc & rm -rf
/opt/oracle/base/diag/rdbms/cdsdb/cdsdb/trace/cdmp* & rm -rf
/opt/oracle/base/diag/rdbms/cdsdb/cdsdb/trace/*.trm & rm -rf
/opt/oracle/base/admin/cdsdb/adump/*.aud[root@Abohamad trace]#


[root@Abohamad sbin]# crontab -lno crontab for root[root@Abohamad sbin]#

Other related posts: