README.rdoc in redis-dump-0.3.1 vs README.rdoc in redis-dump-0.3.2
- old
+ new
@@ -11,13 +11,20 @@
$ 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_full.json redis-load
$ < db_db15.json redis-load -d 15
+ # OR
+ $ cat db_full | redis-load
+ $ cat db_db15.json | redis-load -d 15
+ # You can specify the redis URI via an environment variable
+ $ export REDIS_URI=127.0.0.1:6371
+ $ redis-dump
+
== Output format
All redis datatypes are output to a simple JSON object. All objects have the following 5 fields:
* db (Integer)
@@ -37,9 +44,26 @@
=== 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>the 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).
+== Output directly to an encrypted file
+
+For most sensitive data, you should consider encrypting the data directly without writing first to a temp file. You can do this using the power of [gpg](http://www.gnupg.org/) and file descriptors. Here are a couple examples:
+
+ # Encrypt the data (interactive)
+ $ redis-dump -u 127.0.0.1:6371 -d 15 | gpg --force-mdc -v -c > path/2/backup-db15.json.gpg
+
+ # Encrypt the data (automated)
+ $ redis-dump -u 127.0.0.1:6371 -d 15 | 3</path/2/passphrase.txt gpg --force-mdc -v -c --passphrase-fd 3 > path/2/backup-db15.json.gpg
+
+ # Decrypt the file (interactive)
+ $ gpg path/2/backup-db15.json.gpg
+ Enter passphrase: *******
+
+ # Decrypt the file (automated)
+ $ 3</path/2/passphrase.txt gpg --passphrase-fd 3 path/2/backup-db15.json.gpg
+
== Installation
$ gem install redis-dump
Or of you want to run it directly: