monger

mongodump to S3


License
MIT
Install
pip install monger==0.1.1

Documentation

  1. run mongodump
  2. tar the result
  3. send to S3

This is meant to be used with cron. You probably want some combination of hourly/daily/ backups. Your crontab might look like

0 1 * * * /path/to/mongo_backup.py --config /path/to/config.py --bucket pipeline-hourly
0 0 1 * * /path/to/mongo_backup.py --config /path/to/config.py --bucket ivrhub-daily

This system will currently not purge any backups.

configuration

See the example config file - make a copy with real values somewhere safe. You'll need AWS credentials for accessing S3.

requirements

Use virtualenv and pip:

$ virtualenv /path/to/venv
$ /path/to/venv/bin/activate
(venv)$ pip install -r requirements.txt

testing

The Monger class is tested using nose:

(venv)$ cd monger
(venv)$ nosetests

Change into the package dir to make sure the fixtures are picked up..

script

See backup.py for a script that interfaces with the Monger package.

restoration

All manual for now:

  1. pull down the relevant backup from S3
  2. un-tar it
  3. run mongorestore