Friday, February 08, 2013

Redis

Login to Redis:
redis-cli

Login to Remote Redis:
redis-cli -h 1.2.3.4
auth mypassword

Switch database:
select 1  # where one is the database name

List keys in database:
redis> keys *

Persist everything to disk right away:
save

Get the location of the redis data dump dir:
config get dir
1) "dir"
2) "/var/lib/redis/"

Backup the Redis database datafile:
cp /var/lib/redis/dump.rdb /my/backup/location/

Drop all data in db:
flushdb

No comments: