Created
April 22, 2019 13:47
-
-
Save muratgozel/04b324bd2e7b114172b934e7b758e162 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# set env vars from .env file | |
set -a | |
. $1 | |
set +a | |
# set backup filename | |
datetime=$(date +%Y-%m-%d-%H-%M-%S) | |
filename="${datetime}.gz" | |
filepath=${GOOGLE_DRIVE_BACKUP_PATH}/${MONGODB_NAME}/${filename} | |
# backup | |
/usr/bin/mongodump --port $MONGODB_PORT --host 127.0.0.1 --username $MONGODB_USERADMIN --password "$MONGODB_USERADMIN_PASS" --db $MONGODB_NAME --authenticationDatabase admin --archive=$filepath --gzip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment