OGG运维优化脚本(十九)-进程操作类--辅助操作-创新互联

文件:info.sh  start.sh  stop.sh

创新互联公司-专业网站定制、快速模板网站建设、高性价比西乡塘网站开发、企业建站全套包干低至880元,成熟完善的模板库,直接使用。一站式西乡塘网站制作公司更省心,省钱,快速模板网站建设找我们,业务覆盖西乡塘地区。费用合理售后完善,10年实体公司更值得信赖。

路径 $HOME/ggscript/ggoperat

因为编写了太多脚本后有时候为了查看OGG运行状态不得不频繁的在GGSCI和系统界面切换,所以为了便捷自己写了几个比较简单的脚本,配合alias别名,模拟ggsci内的info start stop功能。同时这几个脚本也可以被其他脚本调用用于操作或者获取进程状态

info.sh

#!/bin/bash if [ $# -eq 0 ]; then         echo "INFO EXTRACT"         exit 2 fi echo $dir cd $HOME/ggscript/ggoperat dir=$PWD cd $HOME if [ -f .profile ];then         . .profile fi if [ -f .bash_profile ];then          . .bash_profile fi cd $dir backuptime=`date +%Y%m%d-%H%M%S` val=$1 val=`echo $val|tr a-z A-Z` if [ `echo $val|grep ^E` ];then          IType=EXTRACT elif [ `echo $val|grep ^P` ];then          IType=POST elif  [ `echo $val|grep ^R` ];then         IType=REPLICAT  else         echo "only can operate the EXTRACT REPLICAT and the POST process"                exit 2 fi pro=`echo $val.PRM|tr A-Z a-z` cd $HOME/ggserver/dirprm if [ ! -e $pro ]; then         echo "the PROCESS is not exist"         exit 2 fi #cd $HOME/ggscript/ggoperat cd $HOME/ggserver (echo INFO $val;echo exit)|./ggsci

start.sh

#!/bin/bash if [ $# -eq 0 ]; then         echo "START EXTRACT"         exit 2 fi echo $dir cd $HOME/ggscript/ggoperat dir=$PWD cd $HOME if [ -f .profile ];then         . .profile fi if [ -f .bash_profile ];then          . .bash_profile fi cd $dir backuptime=`date +%Y%m%d-%H%M%S` val=$1 val=`echo $val|tr a-z A-Z` if [ `echo $val|grep ^E` ];then          IType=EXTRACT elif [ `echo $val|grep ^P` ];then          IType=POST elif  [ `echo $val|grep ^R` ];then         IType=REPLICAT  else         echo "only can operate the EXTRACT REPLICAT and the POST process"                exit 2 fi pro=`echo $val.PRM|tr A-Z a-z` cd $HOME/ggserver/dirprm if [ ! -e $pro ]; then         echo "the PROCESS is not exist"         exit 2 fi #cd $HOME/ggscript/ggoperat cd $HOME/ggserver (echo START $val;echo exit)|./ggsci

stop.sh

#!/bin/bash if [ $# -eq 0 ]; then         echo "STOP EXTRACT"         exit 2 fi echo $dir cd $HOME/ggscript/ggoperat dir=$PWD cd $HOME if [ -f .profile ];then         . .profile fi if [ -f .bash_profile ];then          . .bash_profile fi cd $dir backuptime=`date +%Y%m%d-%H%M%S` val=$1 val=`echo $val|tr a-z A-Z` if [ `echo $val|grep ^E` ];then          IType=EXTRACT elif [ `echo $val|grep ^P` ];then          IType=POST elif  [ `echo $val|grep ^R` ];then         IType=REPLICAT  else         echo "only can operate the EXTRACT REPLICAT and the POST process"                exit 2 fi pro=`echo $val.PRM|tr A-Z a-z` cd $HOME/ggserver/dirprm if [ ! -e $pro ]; then         echo "the PROCESS is not exist"         exit 2 fi #cd $HOME/ggscript/ggoperat cd $HOME/ggserver (echo STOP $val;echo exit)|./ggsci

另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


分享题目:OGG运维优化脚本(十九)-进程操作类--辅助操作-创新互联
当前网址:http://ybzwz.com/article/psdpi.html