Something else that no-one has yet mentioned... I had an instinctive and
visceral knee jerk reaction when I saw 'rm -rf' running as root.
Is there any reason it has to run as root and not the database user?
Running as root you're one mistype away from a really bad day.
On Jun 9, 2015, at 4:17 AM, Mostafa Eletriby (Redacted sender
"m_etrib@xxxxxxxxx" for DMARC) <dmarc-noreply@xxxxxxxxxxxxx> wrote:
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 v5
I 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/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 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 -l
no crontab for root
[root@Abohamad sbin]#