#!/bin/bash

#当前日期
time=`date`


pidno=`ps aux|grep  adserver-beta|grep -v "grep"|awk '{print $2}'`

kill -9 $pidno

if [ $? -ne 0 ]; then
        echo $time"----->old adserver kill failed.." >> /tmp/yechang_adserver_restart.log
else
        echo $time"----->old adserver kill success.." >> /tmp/yechang_adserver_restart.log
fi

sleep 5

adserverpid=`ps aux|grep  adserver|grep -v "grep"|awk '{print $2}'`

if [ "$adserverpid" ];then
      echo $time"----->update success! new version adserver is running now" >> /tmp/yechang_adserver_restart.log
fi

 

crontab -e

38 16 * * * sh /data/sh/yechang_adserver_restart.sh > /dev/null 2>&1

 

相关文章:

  • 2022-12-23
  • 2021-05-22
  • 2021-10-16
  • 2022-12-23
  • 2021-04-07
  • 2022-12-23
  • 2021-06-26
  • 2021-12-18
猜你喜欢
  • 2022-12-23
  • 2021-11-03
  • 2021-09-02
  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
  • 2021-07-25
相关资源
相似解决方案