Warning: Undefined array key "path" in /www/wwwroot/binbinbijissss/wp-content/plugins/wp-chinese-conversion/wp-chinese-conversion.php on line 633
Redis停止後自動重啟解決方案_彬彬筆記

Redis停止後自動重啟解決方案

話不多說,直接上代碼

#!/bin/bash
while true
do
count=`netstat -tunple | grep 6379 |  wc -l`
if [ 1 -gt $count ]; then
echo "Redis has stopped, restart..."
/etc/init.d/redis restart
sleep 1
else
#echo "Redis Run in system"
sleep 1
fi
done

然後在寶塔的定時任務裡面設置一下定時就行了。

發布者:彬彬筆記,轉載請註明出處:https://www.binbinbiji.com/zh-hant/jianzhanjiaoliu/2259.html

贊 (0)
彬彬筆記彬彬筆記
上一篇 2021年7月14日 13:01
aws新購linux服務器怎麼連接,磁盤怎麼掛載
下一篇 2021年11月4日 19:09

相關推薦

發表回復

登錄後才能評論
蜀ICP備14017386號-13