# 指令碼檔案
mac
首先需要安裝redis,可以正常啟動reis
新建啟動redis指令碼 redis-start.sh
sudo vim /opt/redis/redis-start.sh
#!/bin/sh
cd /users/cox/documents/redis-5.0.3/src/ # redis的安裝目錄
./redis-server > out.file 2>&1 & # ./redis-server是啟動redis命令 後面後台啟動
新建關閉redis指令碼
sudo vim /opt/redis/redis-stop.sh
#!/bin/sh
process=`ps -ef|grep redis|grep -v grep|grep -v ppid|awk ''`
for i in $process
do echo "kill the $1 process [ $i ]"
kill -9 $i
done
新建redis指令碼
sudo vim /opt/redis/redis.sh
#!/bin/sh
case $1 in
start) su root /opt/redis/redis-start.sh start;; # 啟動redis
stop) su root /opt/redis/redis-stop.sh start;; # 關閉redis
*) echo "require start|stop" ;;
esac
sudo sh redis.sh start # 啟動redis
sudo sh redis.sh stop # 關閉redis
redis上配置自啟動指令碼
1.開啟自啟動指令碼,路徑為 redis utils redis init script,檔案內容如下所示 bin sh redis init.d script conceived to work on linux systems as it does use of the proc filesys...
搭建redis並配置啟動指令碼
root許可權操作 一.redis安裝 編譯安裝 tar zxvf redis 2.8.17.tar.gz cd redis 2.8.17 make make test make install make distclean清除上次編譯的殘留檔案 拷貝配置檔案 mkdir etc redis cp ...
redis開機自啟動指令碼 linux
目前redis放在home下的資料夾中,寫乙個指令碼,待系統啟動的過程中,去啟動該指令碼。指令碼 redis.sh bin sh home juepei downloads redis 3.0.0 src redis server home juepei downloads redis 3.0.0 ...