encash_thread_mon.sh
#!/bin/bash
a=`ps -elf|grep com.zhcw.h8.encashCenter.EncashThread |grep -v grep|wc -l`
echo $a
if [ $a -gt 0 ]
then
echo `date` "happy8 is running....">/tmp/log.txt
else
echo `date` "happy8 is start ...">/tmp/log.txt
ps -ax|grep com.zhcw.h8.encashCenter.EncashThread |awk '{print $1}'|xargs kill -9
cd /opt/oias/h8/scripts
nohup ./encash_thread.sh &
fi
****************************************************
1-59 * * * * cd /opt/oias/h8/scripts; ./delivery_center.sh
delivery_center_mon.sh
#!/bin/bash
a=`ps -elf|grep com.zhcw.h8.deliveryCenter.Control |grep -v grep|wc -l`
echo $a
if [ $a -gt 0 ]
then
echo `date` "happy8 is running....">/tmp/log.txt
else
echo `date` "happy8 is start ...">/tmp/log.txt
ps -ax|grep com.zhcw.h8.deliveryCenter.Control |awk '{print $1}'|xargs kill -9
cd /opt/oias/h8/scripts
nohup ./delivery_center.sh &
fi