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

From: Iggy Fernandez <iggy_fernandez_at_hotmail.com>
Date: Tue, 9 Jun 2015 06:47:30 -0700
Message-ID: <BLU179-W78C7C88F79225FA5C5AC24EBBE0_at_phx.gbl>



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_at_freelists.org
To: oracle-l_at_freelists.org
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_at_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_at_Abohamad trace]#

[root_at_Abohamad sbin]# crontab -lno crontab for root[root_at_Abohamad sbin]#

--
http://www.freelists.org/webpage/oracle-l
Received on Tue Jun 09 2015 - 15:47:30 CEST

Original text of this message