您好,登錄后才能下訂單哦!
文件: resend.sh
路徑:$HOME/ggscript/ggdef
功能:該腳本為用于應對目標端因為定義文件失效導致的進程異常中斷所設計
因源端業務經常未通知目標端以及系統組自行修改表結構
因此設計該腳本自動生成定義文件,并發送至指定目標機器的相應路徑,以用于目標機器REPLICATE進程的正常讀取
日志路徑:$HOME/gglog/ggupload
#!/bin/bash cd $HOME if [ -f .profile ];then . .profile fi if [ -f .bash_profile ];then . .bash_profile fi if [ $# -eq 0 ]; then echo "info defprm" exit 2 fi mydate=`date +20%y-%m-%d-%H:%M` filename=$1 cd $HOME/ggserver/dirdef if [ ! -d bak ];then mkdir bak && echo "Directory bak created." || echo "Error: Failed to create directory $dr." else echo "bak directory exits!" fi cd $HOME/ggserver/dirprm if [ ! -e $filename ];then echo "the file is not exist!" exit 2 fi cat $filename > $HOME/ggscript/ggdef/temp defsfile=`cat $HOME/ggscript/ggdef/temp |grep DEFSFILE|cut -d '/' -f 3` target=`cat $HOME/ggscript/ggdef/temp |grep TARGET:|cut -d ':' -f 2` release=`cat $HOME/ggscript/ggdef/temp |grep RELEASE:|cut -d ':' -f 2` echo $defsfile $target $release cd $HOME/ggserver/dirdef if [ -d `$defsfile` ];then mv $defsfile bak/$defsfile fi cd $HOME/ggserver if [ "$release" == "10.4" ];then $HOME/gg104/defgen paramfile $HOME/ggserver/dirprm/$filename else ./defgen paramfile $HOME/ggserver/dirprm/$filename fi cd $HOME/ggserver/dirdef echo $target $defsfile size=`cat $defsfile| wc -c` echo $size #exec /bin/bash $HOME/ggscript/ggupload/upload.sh $target $HOME/ggserver/dirdef/$defsfile sysinfo if [ $size -le 1000 ];then exit 2 else /bin/bash $HOME/ggscript/ggupload/upload.sh $target $HOME/ggserver/dirdef/$defsfile sysinfo fi
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。