This project is no longer maintaned in this repository. I keep it for archival purposes. A more up to date and maintained fork of the utility can be found here https://github.com/Sensedia/rutil
rutil is a small command line utility that lets you selectively dump, restore and query a redis database, peek into stored data and pretty print json contents.
go get -v github.com/pampa/rutil
rutil [global options] command [command options] [arguments...]
dump dump redis database to a file
pipe dump a redis database to stdout in a format compatible with | redis-cli --pipe
restore restore redis database from a file
query, q query keys matching the pattern provided by --keys
help, h Shows a list of commands or help for one command
--host, -s "127.0.0.1" redis host
--auth, -a authentication password
--port, -p "6379" redis port
--help, -h show help
--version, -v print the version
rutil dump [command options] [arguments...]
--keys, -k "*" keys pattern (passed to redis 'keys' command)
--match, -m regexp filter for key names
--invert, -v invert match regexp
--auto, -a make up a file name for the dump - redisYYYYMMDDHHMMSS.rdmp
rutil pipe [command options] [arguments...]
--keys, -k "*" keys pattern (passed to redis 'keys' command)
--match, -m regexp filter for key names
--invert, -v invert match regexp
rutil restore [command options] [arguments...]
--dry-run, -r pretend to restore
--flushdb, -f flush the database before restoring
--delete, -d delete key before restoring
--ignore, -g ignore BUSYKEY restore errors
rutil query [command options] [arguments...]
--keys, -k keys pattern (passed to redis 'keys' command)
--match, -m regexp filter for key names
--invert, -v invert match regexp
--delete delete keys
--print, -p print key values
--field, -f [-f option --f option] hash fields to print (default all)
--json, -j attempt to parse and pretty print strings as json