Created
December 10, 2010 01:24
-
-
Save egradman/735622 to your computer and use it in GitHub Desktop.
serve a redis dump.rdb file on the specified port
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# redis-servefile port filename | |
# serves a redis dump.rdb file on the specified port | |
port=$1 | |
file=$2 | |
rundir=`mktemp -d` | |
ln -s $file $rundir | |
redis-server -<<EOF | |
include /etc/redis/redis.conf | |
daemonize no | |
port $port | |
dir $rundir | |
EOF | |
rm -rf $rundir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment