README.rdoc in redis-dump-0.1.0 vs README.rdoc in redis-dump-0.1.1

- old
+ new

@@ -1,16 +1,50 @@ = Redis-Dump v0.1 ALPHA <i>Backup and restore your Redis data to and from JSON.</i> -<b>NOTE: This is alpha software. DO NOT RELY ON IT!!</b> +<b>NOTE: This is alpha software. DO NOT RELY ON IT FOR PRECIOUS THINGS!!</b> +== Usage + +There are two executables: <tt>redis-dump</tt> and <tt>redis-load</tt>. + + $ redis-dump + $ redis-dump -u 127.0.0.1:6371 > db_full.json + $ redis-dump -u 127.0.0.1:6371 -d 15 > db_db15.json + + $ < db_full.json redis-load + $ < db_db15.json redis-load -d 15 + +== Output format + +All redis datatypes are output to a simple JSON object. All objects have the following 5 fields: + +* db (Integer) +* key (String) +* ttl (Integer): The amount of time in seconds that the key will live . If no expire is set, it's -1. +* type (String), one of: string, list, set, zset, hash, none. +* value (String): A JSON-encoded string. For keys of type list, set, zset, and hash, the data is given a specific structure (see below). + +Here are examples of each datatype: + + {"db":0,"key":"hashkey","ttl":-1,"type":"hash","value":{"field_a":"value_a","field_b":"value_b","field_c":"value_c"},"size":42} + {"db":0,"key":"listkey","ttl":-1,"type":"list","value":["value_0","value_1","value_2","value_0","value_1","value_2"],"size":42} + {"db":0,"key":"setkey","ttl":-1,"type":"set","value":["value_2","value_0","value_1","value_3"],"size":28} + {"db":0,"key":"zsetkey","ttl":-1,"type":"zset","value":[["value_0","100"],["value_1","100"],["value_2","200"],["value_3","300"],["value_4","400"]],"size":50} + {"db":0,"key":"stringkey","ttl":79,"type":"string","value":"stringvalue","size":11} + +=== Important note about TTLs + +One of the purposes of redis-dump is the ability to restore the database to a known state. When you restore a redis database from a redis-dump file, <em>expires are reset to their values at the time the dump was created</em>. This is different from restoring from Redis' native .rdb or .aof files (expires are stored relative to the actual time they were set). + + == Installation One of: - $ gem install redis0dump + $ gem install redis-dump == More Info * Codes[http://github.com/delano/redis-dump]