1. dog_fs_curl.sh

more dog_fs_curl.sh 
#!/bin/bash
while true
do
  status=$(ps aux|grep fs-curl | grep -v grep | grep -v bash | wc -l)
  currdate=$(date "+%Y-%m-%d %H:%M:%S")
  if [ "${status}" = "0" ]; then
    echo "${currdate} - fs-curl process is down!!! error!!!" >> curl.err
    cd /opt/program/fs-curl
    sudo java -jar -Dddg.sys.name=CC_VOIP fs-curl.jar &
    
    sleep 2
    currdate=$(date "+%Y-%m-%d %H:%M:%S")
    echo "${currdate} - fs-curl restart over, recheck status." >> curl.err

    status2=$(ps aux|grep fs-curl | grep -v grep | grep -v bash |wc -l)
      if [ "${status2}" = "0"  ]; then
        echo "${currdate} - fs-curl can not restart, start backup machine!!!" >> curl.err
        sudo systemctl stop keepalived.service
      fi
  fi
  sleep 2
done

 

相关文章:

  • 2021-12-23
  • 2022-12-23
  • 2021-10-16
  • 2021-07-15
  • 2021-11-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-19
  • 2021-11-17
  • 2021-11-14
  • 2021-11-02
  • 2021-10-20
  • 2022-12-23
  • 2021-12-13
相关资源
相似解决方案