用shell腳本以ftp方式備份的時(shí)候,碰到KERBEROS_V4 rejected as an authentication type
創(chuàng)新互聯(lián)公司專業(yè)為企業(yè)提供館陶網(wǎng)站建設(shè)、館陶做網(wǎng)站、館陶網(wǎng)站設(shè)計(jì)、館陶網(wǎng)站制作等企業(yè)網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計(jì)與制作、館陶企業(yè)網(wǎng)站模板建站服務(wù),10余年館陶做網(wǎng)站經(jīng)驗(yàn),不只是建網(wǎng)站,更提供有價(jià)值的思路和整體網(wǎng)絡(luò)服務(wù)。
出現(xiàn)這個(gè)的原因是shell腳本中直接使用ftp命令,默認(rèn)的是/usr/kerberos/bin/ftp,這個(gè)和PATH環(huán)境變量有關(guān)
如果使用/usr/bin/ftp就不會出現(xiàn)這個(gè)問題!
#!/bin/sh
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export PATH=$PATH:$ORACLE_HOME/bin:.
export ORACLE_SID=TEST
export NLS_LANG='SIMPLIFIED CHINESE_CHINA.AL32UTF8'
#export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
timedate=$(date +%Y%m%d%H%M%S)
bakdbname=123
bakdbpasswd=123
dumpdbname=123
bakdbhome=/u01/back
expdp $bakdbname/$bakdbpasswd directory=backDir dumpfile=$dumpdbname'_'$timedate.dmp logfile=$dumpdbname'_'$timedate.log
cd /u01
zip -r backup/$dumpdbname'_'$timedate.zip backup/$dumpdbname'_'$timedate.dmp backup/$dumpdbname'_'$timedate.log
find $bakdbhome/123*.log -mtime +3 -exec rm -rf {} \;
find $bakdbhome/123*.zip -mtime +10 -exec rm -rf {} \;
find $bakdbhome/123*.dmp -mtime +3 -exec rm -rf {} \;
cd $bakdbhome
/usr/bin/ftp -v -n 192.168.10.3 >>${dumpdbname}_${timedate}.log << EOF
user ji j123
binary
hash
put ${dumpdbname}_${timedate}.zip ${dumpdbname}_${timedate}.zip
bye
EOF