Docker image with mongodump running as a cron task
Make sure the prerequisites are followed, and the container will be able to run standalone.
Docker
curl -fsSL get.docker.com -o get-docker.sh
sh get-docker.sh
MongoDB
docker run 27017:27017 mongo
Build the app container image locally:
docker build --rm=false -t twnel/<my_image_name> .
docker exec -ti twnel/<my_image_name> bash -c 'sh backup.sh'
Attach a target mongo container to this container and mount a volume to container's /data
folder. Backups will appear in this volume. Optionally set up cron job schedule (default is 0 1 * * *
- runs every day at 1:00 am).
docker run -d \
-v /path/to/target/folder:/backup \ # where to put backups
-e 'CRON_SCHEDULE=0 1 * * *' \ # cron job schedule
--link my-mongo-container:mongo \ # linked container with running mongo
twnel/<my_image_name>
To run backup once without cron job, add no-cron
parameter:
docker run --rm \
-v /path/to/target/folder:/backup \ # where to put backups
--link my-mongo-container:mongo \ # linked container with running mongo
twnel/<my_image_name>
- Create isolated branches for development.
- Commit your changes, rebase locally from dev/beta branch and create pull requests for the dev/beta branch.
- Squash merge when approved and delete the alternate remote branch.
- Rebase the alternate branch locally.
- Pull requests to higher branches will be done merging the commits, no squash or rebase merge will be done.
For the versions available, see the tags on this repository.
- Ericson Cepeda - Initial work - ericson-cepeda
See also the list of contributors who participated in this project.
MIT License - see the LICENSE.md file for details
- This project contains modifications for Twnel specific requirements.