Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: How keep only one copy .dmp?
You might be able to use the -mmin qualifier to the find command,
depending on the version of Linux.
Something like
find $DMPDIR -name "*" -mmin +1380 -exec rm {} \;
Would delete all files older than 23 hours. I have had trouble with
-mtime sometimes because it operates on day boundaries, not hours or
minutes.
Hth,
-joe
-----Original Message-----
From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of J. Dex
Sent: Tuesday, July 17, 2007 8:51 AM
To: oracle-l_at_freelists.org
Subject: How keep only one copy .dmp?
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
--
http://www.freelists.org/webpage/oracle-l
Confidentiality Note: This message contains information that may be confidential and/or privileged. If you are not the intended recipient, you should not use, copy, disclose, distribute or take any action based on this message. If you have received this message in error, please advise the sender immediately by reply email and delete this message. Although ICAT Managers, LLC scans e-mail and attachments for viruses, it does not guarantee that either are virus-free and accepts no liability for any damage sustained as a result of viruses. Thank you.
--
http://www.freelists.org/webpage/oracle-l
Received on Tue Jul 17 2007 - 10:18:03 CDT
![]() |
![]() |