#!/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