Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I want to take backup of a database in the mongodb. I found the command from documentation

mongodump --dbpath /data/db/ --out /data/backup/

But I see there is no any directory called "/data/" in my machine? But I can see the database in mongo shell:

$ mongo
MongoDB shell version: 2.4.9
connecting to: test
> show dbs;
ihtx    0.203125GB
local   0.078125GB
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
263 views
Welcome To Ask or Share your Answers For Others

1 Answer

Good idea to know where the configuration is kept:

$ cat /etc/mongod.conf
# mongod.conf

# Where to store the data.

# Note: if you run mongodb as a non-root user (recommended) you may
# need to create and set permissions for this directory manually,
# e.g., if the parent directory isn't mutable by the mongodb user.
dbpath=/var/lib/mongodb

#where to log
logpath=/var/log/mongodb/mongod.log

But in/var/lib/mongodb as it says there.

The standard installation procedure is here:

http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...