Using mongodump with an auth enabled mongodb server

Posted by bb-generation on Server Fault See other posts from Server Fault or by bb-generation
Published on 2012-09-23T11:25:33Z Indexed on 2012/09/24 9:39 UTC
Read the original article Hit count: 215

I'm trying to do a daily backup of my mongodb server (auth enabled) using the mongodump tool.

mongodump provides two parameters to set the credentials:

-u [ --username ] arg   username
-p [ --password ] arg   password

Unfortunately they don't provide any parameter to read the password from stdin. Therefore everytime I run this command, everyone on the server can read the password (e.g. by using ps aux).

The only workaround I have found is stopping the database and directly accessing the database files using the --dbpath parameter.

Is there any other solution which allows me to backup the mongodb database without stopping the server and without "publishing" my password?

I am using Debian squeeze 6.0.5 amd64 with mongodb 1.4.4-3.

© Server Fault or respective owner

Related posts about linux

Related posts about backup