- run
mongodump
-
tar
the result - 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:
- pull down the relevant backup from S3
- un-
tar
it - run
mongorestore