LINUX 백업 데이터베이스 셸 및 ftp 업로드

                  ,   
#**************************
#     oracle    ,       
#
#**************************
ORACLE_BASE=/export/home/oracle/u01/app/oracle   export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/oracle/product/10.2.0/db_1   export ORACLE_HOME
ORACLE_SID=orcl  export ORACLE_SID
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin  export PATH
NLS_LANG=american_america.zhs16gbk   export NLS_LANG


RUNDATE=$(date +%y%m%d)
SNDDIR=/export/home/oracle/orcl
echo $RUNDATE
echo $SNDDIR

rm -rf $SNDDIR/backup.*.dmp.gz

/export/home/oracle/u01/app/oracle/oracle/product/10.2.0/db_1/bin/exp    /   file=$SNDDIR/backup.$RUNDATE.dmp

gzip -f $SNDDIR/backup.$RUNDATE.dmp
######### uploadftp #############
ftp -n<<!
open 192.168.0.0 
user oracle oracle 
binary 
cd /home/oradata
lcd /export/home/oracle/orcl 
prompt 
put $RUNDATE.dmp
close 
bye !
\ # crontab 정시 작업 편집, 분당 / home / oracle / bak / 1. sh 실행
crontab -e
*/1 * * * * /home/oracle/bak/1.sh >> /home/oracle/bak/backup.log


#/etc/init.d/./crond restart

좋은 웹페이지 즐겨찾기