Tool for automatic backup of MongoDB to S3/DigitalOcean Spaces.
- Build the executable with
go build
- Build the docker image with
docker build -t noxdew/bashdump .
NOTE: This repo has been restructured to work inside Kubernetes Cron Jobs and to upload to a cloud provider bucket. You can still use the older version by checking out to 01f22810647b2e2987853b775f6011bfe4403f1c
and read the README for that version.
- To backup a DB run
bashdump dump
with the environmental variables listed below. It will create a dump and upload it to{prefix}/{year}/{month}/{day}/dump{date}.tar.gz
in your bucket - To restore a DB run
bashdump restore
with the environmental variables listed below. It will find the latest backup in the prefix and restore only databases that are not present in the instance
DO_ACCESS_KEY
: DO or S3 access keyDO_SECRET_ACCESS_KEY
: DO or S3 secret keyDO_SPACES_ENDPOINT
: the DO or S3 endpointDO_SPACES_BUCKET
: the name of the DO Space or S3 bucket bashdump should upload toDO_SPACES_PREFIX
: what is the starting path to the backupsMONGO_URI
: the URI to connect to the mongo instance
are always welcome ❤️