RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
Linux监控进程是否存在的脚本

今天写了一个脚本监控beidouchaind这个进程是否存,如果存在就返回信息并写入日志文件,否则就启动

  1. #!/bin/sh
  2. ps -fe|grep beidouchaind |grep -v grep
  3. if [ $? -ne 0 ]
  4. then
  5. echo ">>>>no beidouchain,run it." `date` >> /root/beidouchain.log
  6. /usr/local/bin/beidouchaind corechain@192.xxx.1.xx:7179 -daemon
  7. else
  8. echo ">>>>beidouchain is running." `date` >> /root/beidouchain.log
  9. fi

在crontab里设置,每分钟调用一次

  1. * * * * * sh /root/monitor_beidouchain_process.sh





网页题目:Linux监控进程是否存在的脚本
文章位置:http://scyingshan.cn/article/gsohhp.html