ITPub博客

首页 > Linux操作系统 > Linux操作系统 > linux ftp脚本

linux ftp脚本

原创 Linux操作系统 作者:oracle_man 时间:2010-03-19 17:45:59 0 删除 编辑

!/bin/ksh

export ORACLE_BASE=/dba
export ORACLE_HOME=/dba/app/oracle/product/9.2.0.8
export EDITOR=vi
. $HOME/.profile

$ORACLE_HOME/bin/sqlplus -S "sf_cos/******@crmrep" </u05/crm_exp_bk/instance1.txt
set feedback off
set head off
set echo off
set heading off
select name from v\$database;
exit
EOF

name=`head -2 /u05/crm_exp_bk/instance1.txt|sed 1d`

if [ $name = "CRM" ]
then
rm -f /u05/crm_exp_bk/crmrep/*
ftp -i -n 10.0.33.8  1>>/u05/crm_exp_bk/crmrep/ftp.log <user oracle oracle
cd /u01/exp_backup
lcd /u05/crm_exp_bk/crmrep
bin
mget *
bye
EOF
fi

$ORACLE_HOME/bin/sqlplus -S "sf_cdh_analyse/*****@crmanl" </u05/crm_exp_bk/instance2.txt
set feedback off
set head off
set echo off
set heading off
select name from v\$database;
exit
EOF

name2=`head -2 /u05/crm_exp_bk/instance2.txt|sed 1d`

if [ $name2 = "CRMANL" ]
then
rm -rf /u05/crm_exp_bk/crmanl/*
ftp -i -n 10.0.33.9 1>>/u05/crm_exp_bk/crmanl/ftp.log << !
user oracle oracle
cd /u01/exp_backup
lcd /u05/crm_exp_bk/crmanl
bin
mget *
bye
!
fi

 

 

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/14474335/viewspace-629959/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2010-03-17

  • 博文量
    15
  • 访问量
    35901