Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: How keep only one copy .dmp?

Re: How keep only one copy .dmp?

From: Luke Davies <luke.davies_at_hansard.com>
Date: Tue, 17 Jul 2007 17:30:33 +0100
Message-id: <469CEEA9.6080002@hansard.com>

How about replacing the find command with

rm -f -- $DMPDIR/*

It seems more straight forward.

Luke

J. Dex wrote:
> How can I set my script to only keep one copy of a dump file? On
> Linux, I have the following line in the script (which is run nightly
> by cron). Yet I always seem to end up with 2 days worth of dmp files
> which are using up too much space. I only want for there to be one
> copy that stays on the server.
>
> find $DMPDIR -name "*" -mtime +0 -exec rm {} \;
>
>
>
> Rest of script that follows that line:
>
> DT=`date +%Y%m%d%H%M`
>
> gzip < $EXPPIPE > $DMPDIR/${ORACLE_SID}_full.dmp.${DT}.gz &
>
> $ORACLE_HOME/bin/exp system/$exppass full=y file=$EXPPIPE
> log=$DMPDIR/${ORACLE_SID}_full_1db_exp_${DT}.log consistent=y compress=y
>
> #Check log for errors below
> cd $DMPDIR
> grep -c "EXP-" ${ORACLE_SID}_full_1db_exp_${DT}.log > /dev/null
> if [ $? = 0 ]
> then
> echo "failed export" | mail -s "export of $ORACLE_SID FAILED CHECK
> LOG FOR DETAILS" `cat $MAIL/dba`
>
> exit 1
> fi
> exit
>
> _________________________________________________________________
> Don't get caught with egg on your face. Play Chicktionary!
> http://club.live.com/chicktionary.aspx?icid=chick_hotmailtextlink2
>
> --
> http://www.freelists.org/webpage/oracle-l
>
>

The contents of this message and any attachments are confidential and are intended for the use of the persons to whom it is addressed. If you are not the intended recipient, you should not copy, forward, use or alter the message in any way, nor disclose its contents to any other person. Please notify the sender immediately and delete the e-mail from your system. The sender is not responsible for any alterations that may have occurred without authorisation. Any files attached to this email will have been checked by us with virus detection software before transmission. You should carry out your own virus checks before opening any attachments, as we do not accept any liability for loss or damage which may be caused by viruses.

For information regarding company registration please visit the contact page at www.hansard.com

--
http://www.freelists.org/webpage/oracle-l
Received on Tue Jul 17 2007 - 11:30:33 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US