Created
October 6, 2021 10:15
-
-
Save RolandWarburton/8cab01c073e136e973f69de6abaf0729 to your computer and use it in GitHub Desktop.
backup mongo
This file contains 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
# change /home/roland/backup to backup location on host | |
# change the username, password, and ip | |
# change the authSource | |
docker run \ | |
-it --name "mongodump" --rm \ | |
-v /home/roland/backup:/data \ | |
-w /data/ \ | |
mongo:4.0 \ | |
mongodump \ | |
--uri="mongodb://username:[email protected]:27017/?authSource=dbname" \ | |
--out="/data/backup" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment