oracle 数据库备份脚本

#!/bin/bash

source /home/oracle/bash_profile

bkHost=21.96.4.10
bkUser=ftp
oracle_dir=
bkPath=/jzdata/filea/app_bk/usr/vch/vch/yjbz/crdd_system/backup_oracl

cd $oracle_dir
expdp cpm/3QAZ2qwe dumpfile=cpm_`date +%Y%m%d`.dmp DIRECTORY=cpm_dir logfile = cpm_`date +%Y%m%d`.log;
gzip cpm_`date +%Y%m%d`.dmp

ftp -v -n $bkHost<<EOF
user $bkUser $bkPasswd
binary
cd $bkPath
lcd $oracle_dir
prompt
mput  cpm_`date +%Y%m%d`.dmp.gz
bye
EOF

find $oracle_dir -name "cpm_*.gz" -type f -mtime +15 -exec  rm {} \;

#30 0 * * * /bin/bash /app/backup/backupWebLog.sh > /dev/null 2>&1 &

 

posted @ 2021-05-28 16:15  wuchangsoft  阅读(318)  评论(0编辑  收藏  举报