宝塔设置redis挂了自动重启得计划任务

2023-08-23 13:45:45 浏览数 (1)

代码语言:javascript复制
ps=`ps -efl|grep redis|grep -v $0|grep -v grep|wc -l`
if [ $ps -eq 0 ];
then
    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

0 人点赞