这个小玩意是帮同事写的.

#!/bin/bash
while :
do
	/bin/sleep 3d
	time=$(date "+%Y-%m-%d %H:%M:%S")
	echo "****$time****"
	PID=`ps -ef|grep mysql|grep -v grep|grep -v PPID|awk '{ print $2}'`
	if [ ! -n "$PID" ]; then
		echo "not process"
	else
		echo "is process"
		/usr/bin/kill -9 $PID
		#/opt/mysql/start.sh
		echo "reboot success"
	fi

done

  

做个笔记。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-20
  • 2022-01-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-01
  • 2022-12-23
  • 2021-07-29
  • 2021-11-12
  • 2022-12-23
相关资源
相似解决方案