.gitignore | ||
dbbackup-mongo | ||
dbbackup-mongo-cron | ||
default-mongo.conf-sample | ||
LICENSE | ||
README.md |
This is a bash script, run by cron, which creates backups using a editable command. This is used for, say, backing up Docker-based MongoDBs, to a designated directory. Each backup file created (usually hourly) is timestamped. 24 hourly instances, 7 daily, 4 weekly, 12 monthly, and 7 yearly versions of each file being backed up are retained automatically. A "Success" or "Error" log is automatically sent to a designated email address. To install, create the directory - /home/data/scripts/mongobackup by default - for this code.
git clone git@git.oeru.org:oeru/mongobackup.git /home/data/scripts/mongobackup
Copy default-mongo.conf-sample to default-mongo.conf and edit it to customise it to set various directories (you'll need to create those that don't yet exist!)
cp default-mongo.conf-sample default-mongo.conf
Link the cron file to enable it
ln -sf /home/data/scripts/mongobackup/dbbackup-mongo-cron /home/data/scripts/cron.d
To run it manually, in this case testing hourly backups...
/home/data/scripts/mongobackup/dbbackup-mongo --verbose --hourly