Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

OGG Operation and maintenance Optimization script (19)-process Operation Class-Auxiliary Operation

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

File: info.sh start.sh stop.sh

Path $HOME/ggscript/ggoperat

Because after writing too many scripts, sometimes in order to check the running status of OGG, I have to switch frequently between GGSCI and the system interface, so for convenience, I wrote a few relatively simple scripts, together with alias aliases, to simulate the info start stop function in ggsci. At the same time, these scripts can also be called by other scripts to operate or get the process status.

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% dmurf% H% M% S`val = $1vale = `echo $val | tr Amurz 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 Amurz-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% dmurf% H% M% S`val = $1vale = `echo $val | tr Amurz 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 Amurz-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% dmurf% H% M% S`val = $1vale = `echo $val | tr Amurz 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 Amurz-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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report