From 9d92343fab3b1d2b42afceb5f8ff9ae30c2f4675 Mon Sep 17 00:00:00 2001 From: ycz008 Date: Sat, 27 Jul 2024 11:40:36 +0800 Subject: [PATCH] add mongodb backup --- build-image/mongo/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-image/mongo/entrypoint.sh b/build-image/mongo/entrypoint.sh index 1ebd9dd..1b98751 100755 --- a/build-image/mongo/entrypoint.sh +++ b/build-image/mongo/entrypoint.sh @@ -6,7 +6,7 @@ dbs=($DATABASES) for db in "${dbs[@]}" do - mongodump --host ${HOST} --port ${PORT} --authenticationDatabase admin -u root -p ${PASSWORD} --db $db --gzip --archive=${db}.tgz + mongodump --host ${HOST} --port ${PORT} --authenticationDatabase admin -u backup -p ${PASSWORD} --db $db --gzip --archive=${db}.tgz if (($?==0));then aws s3 cp ${db}.tgz s3://bfs-pkg-storage/mongodb/backup/${datetime}/ else