Git Product home page Git Product logo

docker-mongodb-backup's Introduction

tiredofit/mongodb-backup

Introduction

This will build a container for backing up MongoDB containers.

  • dump to local filesystem
  • select database user and password
  • backup all databases or specific database
  • choose to have an MD5 sum after backup for verification
  • delete old backups after specific amount of time
  • choose compression type (none, gz, bz, xz)
  • connect to any container running on the same system
  • select how often to run a dump
  • select when to start the first dump, whether time of day or relative to container start time

This Container uses Alpine:Edge as a base.

Changelog

Authors

Table of Contents

Prerequisites

You must have a working MongoDB server available for this to work properly, it does not provide server functionality!

Installation

Automated builds of the image are available on Docker Hub and is the recommended method of installation.

docker pull tiredofit/mongodb-backup

Quick Start

NOTE: If you are using this with a docker-compose file along with a seperate SQL container, take care not to set the variables to backup immediately, more so have it delay execution for a minute, otherwise you will get a failed first backup.

Configuration

Data-Volumes

The following directories are used for configuration and can be mapped for persistent storage.

Directory Description
/backups SQL Backups

Environment Variables

Along with the Environment Variables from the Base image, below is the complete list of available options that can be used to customize your installation.

Parameter Description
DB_HOST server name
DB_NAME (optional) database name
DB_USER (optional) username for the database
DB_PASS (optional) password for the database
DB_AUTH (optional) authentication database
DB_DUMP_FREQ How often to do a dump, in minutes. Defaults to 1440 minutes, or once per day.
DB_DUMP_BEGIN What time to do the first dump. Defaults to immediate. Must be in one of two formats
Absolute HHMM, e.g. 2330 or 0415
Relative +MM, i.e. how many minutes after starting the container, e.g. +0 (immediate), +10 (in 10 minutes), or +90 in an hour and a half
DB_DUMP_DEBUG If set to true, print copious shell script messages to the container log. Otherwise only basic messages are printed.
DB_DUMP_TARGET Where to put the dump file, should be a directory. Supports three formats
Local If the value of DB_DUMP_TARGET starts with a / character, will dump to a local path, which should be volume-mounted.
DB_CLEANUP_TIME Value in minutes to delete old backups (only fired when dump freqency fires). 1440 would delete anything above 1 day old. You don't need to set this variable if you want to hold onto everything.
COMPRESSION Use either Gzip (GZ), Bzip2 (BZ), XZip (XZ), or none (NONE). (Default GZ)
MD5 Generate MD5 Sum in Directory, TRUE or FALSE (Default TRUE)

Maintenance

Shell Access

For debugging and maintenance purposes you may want access the containers shell.

docker exec -it (whatever your container name is e.g.) mongodb-backup bash

docker-mongodb-backup's People

Contributors

pcantaluppi avatar tbpoetke avatar tiredofit avatar unlink avatar vagrantpi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.