exp.sh 指令碼

yezhibin發表於2010-03-04
target='system/passwd'                             
time=`date '+%d'`                        
cmdfile=/home/oracle9i/exp/parafile.dat     
                                               
cat <$cmdfile                           
file=/home/oracle9i/exp/exp.$time.dmp
log=/home/oracle9i/exp/log/exp.$time.log
owner=('RIDEKF', 'RODE')
feedback=1000
EOF
exp $target parfile=$cmdfile

find /home/oracle9i/exp/ \( -name '*.log' -o  -name '*.dmp' \) -ctime +7 -exec rm {} \;

#time=`expr  $time  - 7`
#if
#  [ "$time" -gt 10 ]
#then
#rm /home/oracle9i/exp/exp.$time.dmp
#else
#rm /home/oracle9i/exp/exp.0$time.dmp
#fi

xmkf_A36_/home/oracle9i/exp>cat parafile.dat
file=/home/oracle9i/exp/exp.03.dmp
log=/home/oracle9i/exp/log/exp.03.log
owner=('RIDEKF', 'RODE')
feedback=1000

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/354732/viewspace-628568/,如需轉載,請註明出處,否則將追究法律責任。

相關文章