文件:processinfo.sh
路径:$HOME/ggscript/ggupload
功能:该脚本为满足维护配置时检查所有goldengate进程的详细源端目标端,定义文件等信息而设计
如果未按照脚本部署准备进行内容注释,输出结果会为空
如果有其他注释信息,输出结果会被干扰
#!/bin/bash export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin" echo "This sciprt is write by RenYi" hn=`echo $HOSTNAME` usr=`echo $USER` echo $hn-$usr cd $HOME/ggserver (echo info all;echo exit)|./ggsci|grep -E "EXTRACT|REPLICAT" |awk 'BEGIN {FS=" +"} {print $3}' > $HOME/ggscript/ggupload/temp cd $HOME/ggscript/ggupload cat temp |tr A-Z a-z > temp2 sed 's/$/.prm/' temp2 > temp3 rm -f temp2 i=1 num=`sed -n '$=' temp3` echo -n -e "+-----------------------------------------------------------------------------------------------------------------------------+\n" printf "%-1s %-15s %-1s %-15s %-1s %-16s %-1s %-12s %-1s %-16s %-1s %-15s %-1s %-16s %-1s\n" \| process \| source \| sourceip \| target \| targetip \| defsfile \| defprm \| cd $HOME/ggserver/dirprm while [ "$i" -le "$num" ] do fname=`sed -n $i'p' $HOME/ggscript/ggupload/temp3` pname=`sed -n $i'p' $HOME/ggscript/ggupload/temp` source=`cat $fname|grep -w "source" |cut -d ':' -f 2` while [ ${#source} -le 2 ] do source=none done sourceip=`cat $fname|grep -w "sourceIP" |cut -d ':' -f 2` while [ ${#sourceip} -le 2 ] do sourceip=none done target=`cat $fname|grep -w "target" |cut -d ':' -f 2` while [ ${#target} -le 2 ] do target=none done targetip=`cat $fname|grep -w "targetIP" |cut -d ':' -f 2` while [ ${#targetip} -le 2 ] do targetip=none done defsfile=`cat $fname|grep -w "defsfile" |cut -d ':' -f 2` while [ ${#defsfile} -le 2 ] do defsfile=none done defprm=`cat $fname|grep -w "defprm" |cut -d ':' -f 2` while [ ${#defprm} -le 2 ] do defprm=none done echo -n -e "+-----------------------------------------------------------------------------------------------------------------------------+\n" printf "%-1s %-15s %-1s %-15s %-1s %-16s %-1s %-12s %-1s %-16s %-1s %-15s %-1s %-16s %-1s\n" \| $pname \| $source \| $sourceip \| $target \| $targetip \| $defsfile \| $defprm \| ((i++)); done cd $HOME/ggscript/ggupload echo -n -e "+-----------------------------------------------------------------------------------------------------------------------------+\n"
查询结果
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。