docker run --rm --link <local machine docker container name>:mongo [--network accountpool-net] -v <local machine directory>:/backup mongo bash -c 'mongodump --out /backup --host mongo:27017 --username <username> --password <password> -d <db name>'
docker run --rm --link <local machine docker container name>:mongo -v <local machine directory>:/backup mongo bash -c 'mongorestore /backup --host mongo:27017 --username <username> --password <password>'
example:
local machine directory: /home/ubuntu/accountPool_bak/2019-04-19
网友评论