宝塔redi状态检测 如果停止则重启 放计划任务
作者:互联网
ps=`ps -efl|grep redis|grep -v $0|grep -v grep|wc -l` if [ $ps -eq 0 ]; then rm -f /www/server/redis/redis.pid echo -e "\n$(date '+%Y-%m-%d %H:%M:%S') start " /etc/init.d/redis start echo "$(date '+%Y-%m-%d %H:%M:%S') done" else echo $(date +%F%n%T) "redis正在运行..." exit 0; fi
标签:-%,宝塔,grep,ps,重启,redis,echo,date,redi 来源: https://www.cnblogs.com/lgms2008/p/14770789.html