重启redis shell脚本

 

#!/bin/bash
ss -tnl | grep 6379

if [ $? -eq 0 ];then

ps -ef | grep redis | awk 'NR==1 {print $2}' | xargs kill -9 && nohup /usr/local/redis/redis-server /usr/local/redis/redis.conf > myout.file 2>&1 &

else

nohup /usr/local/redis/redis-server /usr/local/redis/redis.conf > myout.file 2>&1 &

fi

posted @ 2020-09-24 16:34  铜锣湾扛把子·66  阅读(395)  评论(0)    收藏  举报