文件:info.sh start.sh stop.sh
路径 $HOME/ggscript/ggoperat
因为编写了太多脚本后有时候为了查看OGG运行状态不得不频繁的在GGSCI和系统界面切换,所以为了便捷自己写了几个比较简单的脚本,配合alias别名,模拟ggsci内的info start stop功能。同时这几个脚本也可以被其他脚本调用用于操作或者获取进程状态
info.sh
#!/bin/bashif [ $# -eq 0 ]; then echo "INFO EXTRACT" exit 2fiecho $dircd $HOME/ggscript/ggoperatdir=$PWDcd $HOMEif [ -f .profile ];then . .profilefiif [ -f .bash_profile ];then . .bash_profileficd $dirbackuptime=`date +%Y%m%d-%H%M%S`val=$1val=`echo $val|tr a-z A-Z`if [ `echo $val|grep ^E` ];then IType=EXTRACTelif [ `echo $val|grep ^P` ];then IType=POSTelif [ `echo $val|grep ^R` ];then IType=REPLICAT else echo "only can operate the EXTRACT REPLICAT and the POST process" exit 2fipro=`echo $val.PRM|tr A-Z a-z`cd $HOME/ggserver/dirprmif [ ! -e $pro ]; then echo "the PROCESS is not exist" exit 2fi#cd $HOME/ggscript/ggoperatcd $HOME/ggserver(echo INFO $val;echo exit)|./ggsci
start.sh
#!/bin/bashif [ $# -eq 0 ]; then echo "START EXTRACT" exit 2fiecho $dircd $HOME/ggscript/ggoperatdir=$PWDcd $HOMEif [ -f .profile ];then . .profilefiif [ -f .bash_profile ];then . .bash_profileficd $dirbackuptime=`date +%Y%m%d-%H%M%S`val=$1val=`echo $val|tr a-z A-Z`if [ `echo $val|grep ^E` ];then IType=EXTRACTelif [ `echo $val|grep ^P` ];then IType=POSTelif [ `echo $val|grep ^R` ];then IType=REPLICAT else echo "only can operate the EXTRACT REPLICAT and the POST process" exit 2fipro=`echo $val.PRM|tr A-Z a-z`cd $HOME/ggserver/dirprmif [ ! -e $pro ]; then echo "the PROCESS is not exist" exit 2fi#cd $HOME/ggscript/ggoperatcd $HOME/ggserver(echo START $val;echo exit)|./ggsci
stop.sh
#!/bin/bashif [ $# -eq 0 ]; then echo "STOP EXTRACT" exit 2fiecho $dircd $HOME/ggscript/ggoperatdir=$PWDcd $HOMEif [ -f .profile ];then . .profilefiif [ -f .bash_profile ];then . .bash_profileficd $dirbackuptime=`date +%Y%m%d-%H%M%S`val=$1val=`echo $val|tr a-z A-Z`if [ `echo $val|grep ^E` ];then IType=EXTRACTelif [ `echo $val|grep ^P` ];then IType=POSTelif [ `echo $val|grep ^R` ];then IType=REPLICAT else echo "only can operate the EXTRACT REPLICAT and the POST process" exit 2fipro=`echo $val.PRM|tr A-Z a-z`cd $HOME/ggserver/dirprmif [ ! -e $pro ]; then echo "the PROCESS is not exist" exit 2fi#cd $HOME/ggscript/ggoperatcd $HOME/ggserver(echo STOP $val;echo exit)|./ggsci