OGG运维优化脚本(三.五)-信息修改类--附加日志增加
文件名: addtrandata.sh
成都创新互联公司是一家专注于成都做网站、成都网站建设与策划设计,洛龙网站建设哪家好?成都创新互联公司做网站,专注于网站建设十年,网设计领域的专业建站公司;建站业务涵盖:洛龙等地区。洛龙做网站价格咨询:18980820575
所在路径:$HOME/ggscript/gginsert
功能:用于批量增加表附加日志,属于从加表脚本中独立出来的功能,用于应对表附加日志丢失以及加表附加日志增加失败的情况
#!/bin/bash echo "This script will add trandata( by RenYi)" ls -lrt $HOME/ggserver/dirprm/e*.prm echo "The EXTRACT process:" cd $HOME/ggserver (echo info all;echo exit)|./ggsci|grep "EXTRACT" |awk 'BEGIN {FS=" +"} {print $3}'|grep '^E' cd $HOME/ggscript/gginsert echo "Please press any key" read -n 1 read -p "Please enter the EXTRACT name:" val2 val=`echo $val2.PRM|tr A-Z a-z` cd $HOME/ggserver/dirprm if [ ! -e $val ]; then echo "the EXTRACT is not exist" echo "the EXTRACT is not exist" >> ''$HOME'/gglog/gginsert/InsertLog-'$backuptime'.log' exit 2 fi echo "Please Enter the table (Please enter any key)" read -n 1 cat /dev/null > trandaTmp vi trandaTmp sed 's/^/add trandata /' trandaTmp > addtrandata NUX=`sed -n '$=' addtrandata` echo $NUX i=1 echo $i cd $HOME/ggserver echo dblogin `more $HOME/ggserver/dirprm/$val|grep USERID` > dirdat/addtrandata echo $login while [ "$i" -le "$NUX" ] do sed -n "${i}p" $HOME/ggscript/gginsert/addtrandata >> dirdat/addtrandata i=`expr $i + 1` done echo OBEY dirdat/addtrandata |./ggsci
标题名称:OGG运维优化脚本(三.五)-信息修改类--附加日志增加
网站路径:http://scyanting.com/article/pjppjo.html