Executing batches of commands using redis cli

If you don't want to make a file, use echo and \n

echo "DEL 9012012\nDEL 1212" | redis-cli

The redis-cli --pipe can be used for mass-insertion. It is available since 2.6-RC4 and in Redis 2.4.14. For example:

cat data.txt | redis-cli --pipe

More info in: http://redis.io/topics/mass-insert


the following code works for me with redis 2.4.7 on mac

./redis-cli < temp.redisCmds

Does that satisfy your requirements? Or are you looking to see if there's a way to programmatically do it faster?

Tags:

Redis