#!/usr/bin/bash

#Tate:2022.3.28
#Author:Yingjian
#function: 定时检测sersync2进程存活
#env
Date2=`date +%F`
Date=`date +%Y%m%d_%H_%M`
pidlist=`ps -ef| grep -v grep |grep sersync2 |awk '{print $2}'`
if [ "$pidlist" != "" ];then
echo "$Date Sersync2进程存活 进程ID为$pidlist" >>/var/log/${Date2}check_rsync.log
else
echo "$Date Sersync2进程不存在，正在启动" >>/var/log/${Date2}check_rsync.log
killall sersync2 || /usr/local/sersync/sersync2 -dro /usr/local/sersync/confxml.xml
fi
