A script to backup your MongoDB databases to Amazon S3
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config
infra
lib
test
.editorconfig
.env
.gitignore
.istanbul.yml
.jshintrc
.travis.yml
LICENSE
Makefile
README.md
app.ts
backup.ts
gulpfile.js
package.json
tsconfig.json
tslint.json
yarn.lock

README.md

Mongo S3 Backup

Build Status Coverage Status

A script to backup your MongoDB databases and store them on Amazon S3.

It generates a dump from your MongoDB databases, compresses this dump as tar.bz2, generates a hash file for integrity check and then uploads both files to your Amazon S3 bucket.

In order to test it, be sure to have the following dependencies installed on your system:

Before running anything, please configure your AWS credentials inside the .env file.

You can run the backup script directly on your system and configure cron by yourself or use the Docker config provided.

In order to start the Docker container and configure cron inside of it to run the script every day at 00:00 CET, run:

$ make

In order to start this container automatically if your server reboots:

  • Change the path inside the file infra/host/etc/systemd/system/mongo-backup.service to be the path where you put the mongo-s3-backup source code.
  • As root, copy this file to /etc/systemd/system in your server
  • Enable and start it:
# systemctl enable mongo-backup
# systemctl start mongo-backup

If you don't want to use Docker, just run instead:

$ make no-docker

And then configure the script directly on your system's cron.