add mongodb backup

main
ycz008 2024-07-27 11:40:36 +08:00
parent 7bbe2dcf5f
commit 9d92343fab
1 changed files with 1 additions and 1 deletions

View File

@ -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