emmm,关于博客概率性打不开的问题
经过排查cdn与源站服务器发现是因为该死的nginx自己stop了
于是写了个自动检测nginx存活检测的小脚本,宝塔后台添加定时任务即可
nginx_procnum=`ps -ef|grep "nginx"|grep -v grep|wc -l`
if [ $nginx_procnum -eq 0 ]
then
echo "nginx is stopped!"
systemctl restart nginx > /dev/null 2>&1
else
echo "nginx is running!"
fi
(没配图看着不舒服,所以随手截了一张)
January 30,2024 04:01:35
阅读319
撰写评论