重启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  哦~杰克  阅读(372)  评论(0编辑  收藏  举报