首页 > Linux操作系统 > Linux操作系统 > linux ftp脚本
!/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" <
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 <
cd /u01/exp_backup
lcd /u05/crm_exp_bk/crmrep
bin
mget *
bye
EOF
fi
$ORACLE_HOME/bin/sqlplus -S "sf_cdh_analyse/*****@crmanl" <
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/ ,如需转载,请注明出处,否则将追究法律责任。