artsy/flux — pull request #35 by macreery (2013-03-18 23:24:59+00:00)
Title: rake db:restore task, and some pre-upgrade cleanup

* Merge in recent pull requests (#33, #34) from the **master** branch
* Mass-replace all camel-cased variable names with underscorized versions (Gravity PR upcoming)
* Rename MaQuery Language –> McQuery Language
* Add a `RestoreFromBackup` performable class, and a `db:restore` Rake task, to simplify the process of restoring a local Redis database from an S3 backup in development mode. To use, set `S3_ACCESS_KEY_ID` and `S3_SECRET_ACCESS_KEY` in your environment and run:

```shell
rake db:restore[s3://flux-daily-backups/dump.rdb]
```

Note that if you've set `S3_BACKUP_FILE` in your environment, the argument to the Rake task is unnecessary.

Also note that running this Rake task **will** shut down your Redis server. If you're using OS X's `launchd` to start Redis on your development machine (the default configuration), make sure that the LaunchAgent .plist has `KeepAlive` set to `true`. This will force the server to restart after a client triggers a shutdown.

```
KeepAlive

```

I realize this `RestoreFromBackup` functionality is arguably not the purview of the Flux server library, but I feel that it's useful enough to include. Moreover, if we mirror or move some of the corresponding backup code that's currently in our cookbooks' **etc/create-master-backup.rb** into a separate `CreateBackup` performable class, the two would go side by side nicely.