本人实例:

#!/bin/bash

ps -ef | grep elastic | grep -v grep
if [ $? -ne 0 ]
then
echo "start process......"
echo 1 > /proc/sys/vm/drop_caches;
cd /data/soft/elasticsearch-6.4.0/bin/;
su elsearch;
./elasticsearch -d;
else
echo "runing......"
fi

这是检测搜索引擎 elastic 的脚本

 


#!/bin/bash

ps -ef | grep mysqld | grep -v grep
if [ $? -ne 0 ]
then
echo "start process......"
/etc/rc.d/init.d/mysqld start
else
echo "runing......"
fi

这是检测mysql 进程的 脚本

 

相关文章:

  • 2020-04-28
  • 2021-07-18
  • 2021-01-12
  • 2020-04-16
  • 2021-12-10
  • 2019-11-30
  • 2019-03-17
  • 2018-06-02
猜你喜欢
  • 2018-06-07
  • 2018-11-30
  • 2021-08-09
  • 2018-07-16
  • 2019-03-04
  • 2021-09-18
  • 2018-09-15
  • 2021-12-28
相关资源
相似解决方案