#!/bin/bash redis_dir="/usr/local/redis" redis_conf="/usr/local/redis/redis.conf" time=`date` log="/tmp/redis.log" rediss=`ps -ef|grep -v vim |grep -v grep |grep redis-server|grep 6379|wc -l` if [ ${rediss} -eq 0 ];then ${redis_dir}/bin/redis-server ${redis_conf} echo "${time}-->redis has shutdown,now it startup." >> ${log} exit 1 fi echo "${time}-->redis is running" >> ${log} log_count=`cat $log |wc -l` if [ $log_count -gt 5000 ];then sed -i ‘1,1000d‘ $log fi
时间: 2024-10-27 03:40:39