[英]Specifying dump directory in mongod.cfg file
All, 所有,
Is there a system wide setting to specify the dump folder in MongoDB? 是否有系统范围的设置来指定MongoDB中的转储文件夹? I went through this link and couldn't find any. 我通过此链接 ,找不到任何链接 。
Basically, I want C:\\MongoDB\\dump to be the folder where all backups are created. 基本上,我希望C:\\ MongoDB \\ dump是创建所有备份的文件夹。 Currently, a dump folder is created in the folder mongodump is executed in or one has to specify a folder explicitly using --out parameter as a part of mongodump. 当前,在执行mongodump的文件夹中创建了一个转储文件夹,或者必须使用--out参数明确指定一个文件夹作为mongodump的一部分。
Instead, wherever I may execute mongodump from, I want the dumps to be always created in C:\\MongoDB\\dump 相反,无论我在哪里执行mongodump,我都希望转储始终在C:\\ MongoDB \\ dump中创建
Thanks, rgn 谢谢,rgn
您可以使用mongodump
mongodump --host mongodb1.example.net --port 37017 --username user --password "pass" --out /opt/backup/mongodump-2011-10-24
If you do not specify the --out
paramater to the mongodump
, it will create a dump
directory in the current directory to store the database dump. 如果不指定--out
paramater到mongodump
,它会创建一个dump
在当前目录的目录来存放数据库的转储。
You can set a system level parameter for the base directory for all of your dumps. 您可以为所有转储的基本目录设置系统级参数。 However, for every mongodump
you take you will have to pass the --out parameter to uniquely identify that dump. 但是,对于您执行的每个mongodump
,您都必须传递--out参数以唯一地标识该转储。
Failing to do so will overwrite the existing dumps within your base dump directory 否则,将覆盖基本转储目录中的现有转储
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.