shell_ judgment

#判断增量脚本进程是否还在 
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
Published 322 original articles · won praise 3 · views 10000 +

Guess you like

Origin blog.csdn.net/wj1298250240/article/details/104819253