https://github.com/startupjs/docker-mongo-backup
https://github.com/startupjs/docker-mongo-backup
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/startupjs/docker-mongo-backup
- Owner: startupjs
- Created: 2021-03-04T14:48:46.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-05-16T11:38:36.000Z (about 3 years ago)
- Last Synced: 2025-01-24T04:52:03.724Z (4 months ago)
- Language: Shell
- Size: 16.6 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Mongodb cron backup to Google Cloud Storage (GCE)
## How To Use
```
docker run -d -e PROJECT_ID=unique_id_on_gce -e GS_ID=gs_access_key_id -e GS_SECRET=gs_secret_access_key -e MONGO_HOST=127.0.0.1:27017 -e MONGO_USER=user -e MONGO_PASS=password -e BUCKET=storage-bucket -e CRON_TIME="0 1 * * *" startupjs/mongo-backup:master
```## Environment Variables
#### PROJECT_ID - [Demo(3)](https://storage.googleapis.com/cdn.chessboardradio.com/lab/docker-mongodb-backup-gce/get-storage-keys.png)
The project id on Google Cloud, need be the **default**.#### GS_ID - [Demo(4)](https://storage.googleapis.com/cdn.chessboardradio.com/lab/docker-mongodb-backup-gce/get-storage-keys.png)
The **Access Key** of Interoperability session.#### GS_SECRET - [Demo(4)](https://storage.googleapis.com/cdn.chessboardradio.com/lab/docker-mongodb-backup-gce/get-storage-keys.png)
The **Secret Key** of Interoperability session.#### BUCKET
The bucket name, need create the bucket on Google Cloud Console before.#### MONGO_HOST
The IP or domain of your Mongodb server, with the port (127.0.0.1:27017).#### MONGO_USER
If your server need authentication, set the user of current database.#### MONGO_PASS
Like before but for the password.#### AUTHDB
If you are using authentication, set the [authentication database](https://docs.mongodb.com/database-tools/mongodump/#std-option-mongodump.--authenticationDatabase)#### CRON_TIME
The **cron time**, the frequency that will generate a new backup, default is `0 1 * * *` every day at 1am (GTM).
Here is a good [cron generator](http://crontab-generator.org/).