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

From: Ryan January <rjanuary_at_gmail.com>
Date: Tue, 9 Jun 2015 12:43:56 -0500
Message-Id: <4D55A39C-4046-4847-85AE-CAE3A1EEB96B_at_gmail.com>



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_at_yahoo.com" for DMARC) <dmarc-noreply_at_freelists.org> 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_at_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_at_Abohamad trace]#
>
>
>
> [root_at_Abohamad sbin]# crontab -l
> no crontab for root
> [root_at_Abohamad sbin]#
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Tue Jun 09 2015 - 19:43:56 CEST

Original text of this message