Update mongobackup.sh

This commit is contained in:
deflax 2018-09-07 00:56:33 +03:00 committed by GitHub
parent 6ad08b33c7
commit 309af4f0fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,7 +26,7 @@ TIMESTAMP=`date +%F-%H%M`
mkdir -p "${BACKUPS_DIR}/backup_${TIMESTAMP}"
for db in $dbs; do
echo "database backup $db at $TIMESTAMP"
$MONGODUMP_PATH --username $MONGO_USER --password $MONGO_PASS --authenticationDatabase admin --host $MONGO_HOST:$MONGO_PORT --db$db --out "${BACKUPS_DIR}/backup_${TIMESTAMP}"
$MONGODUMP_PATH --username $MONGO_USER --password $MONGO_PASS --authenticationDatabase admin --host $MONGO_HOST:$MONGO_PORT --db $db --out "${BACKUPS_DIR}/backup_${TIMESTAMP}"
done
tar -czvf "${BACKUPS_DIR}/backup_${TIMESTAMP}.tar.gz" "${BACKUPS_DIR}/backup_${TIMESTAMP}"
rm -fr "${BACKUPS_DIR}/backup_${TIMESTAMP}"