redis Windows平台启动脚本

来源:互联网 发布:虚拟机安装教程linux 编辑:程序博客网 时间:2024/06/07 14:46

我所下载的redis[http://blog.csdn.net/yueaini10000/article/details/72761092]是没有启动文件,每次启动都需要自己手动进入根目录,然后在运行文件
颇为麻烦
于是就萌生了写一个脚本的想法,然后就按照Tomcat的启动脚本为蓝本写了一个redis的启动脚本

@echo offrem by:czh60601@126.comsetlocalrem Guess REDIS_HOME if not definedset "CURRENT_DIR=%cd%"if not "%REDIS_HOME%" == "" goto gotHomeset "REDIS_HOME=%CURRENT_DIR%"set "REDIS_HOME=%cd%"cd "%CURRENT_DIR%":gotHomeif exist "%REDIS_HOME%\redis-server.exe" goto okHomeecho The REDIS_HOME environment variable is not defined correctlyecho This environment variable is needed to run this programgoto end:okHomerem Check redis.windows.conf existsif exist "%REDIS_HOME%\redis.windows.conf" goto okExececho Cannot find "%REDIS_HOME%\redis.windows.conf"echo This file is needed to run this programgoto end:okExecstart redis-server.exe redis.windows.conf:end
原创粉丝点击