Linux 进程终止后自动重启时间:2023-03-09 05:35:59 /opt/a.sh #! /bin/bash ps -ef | grep python3 a.py | grep -v grep | grep python3 if [ $? -ne 0 ] then cd /opt/a.py && python3 a.py else echo "running" fi 之后写一个定时脚本2分钟捕捉一次 2 * * * * /opt/a.sh