#判断增量脚本进程是否还在
ps -ef |grep "sh new_sync_data.sh" |grep -v "grep" | grep -v "vim" >>/dev/null
if [ $? -ne 0 ]
then
mkdir -p ${currentPath}/proccessLog >>/dev/null
echo "ERROR ${currentTime} new_sync_data.sh 脚本进程死亡" >> ${currentPath}/proccessLog/${currentDay}.log
# exit 1
else
mkdir -p ${currentPath}/proccessLog >>/dev/null
echo "INFO ${currentTime} new_sync_data.sh is runing....." >> ${currentPath}/proccessLog/${currentDay}.log
fi
#读取表文件 判断文件是否存在
if [ -f $tab ];then
tab=`cat ${tab}`
else
echo "ERROR ${currentTime} inspect目录下的table.txt表配置文件不存在!" >> ${currentPath}/proccessLog/${currentDay}.info
exit 1
fi
#判断服务器是否正常
function connect_server(){
ping -c 3 -W 5 47.99.*.* &>/dev/null
if [ "$?" == "0" ];then
return 0
else
return 1
fi
}
shell_判断进程文件是否存在
最新推荐文章于 2023-09-06 11:02:50 发布