title: How to get a consistent MongoDB backup for a single node setup
body: <p>I'm using MongoDB in a pretty simple setup and need a consistent backup strategy.  I found out the hard way that wrapping a <code>mongodump</code> in a lock/unlock is a bad idea.  Then I read that the <code>--oplog</code> option should be able to provide consistency without lock/unlock.  However, when I tried that, it said that I could only use the <code>--oplog</code> option on a "full dump."  I've poked around the docs and lots of articles but it still seems unclear on how to dump a mongo database from a single point in time.</p>
  
  <p>For now I'm just going with a normal dump but I'm assuming that if there are writes during the dump it would make the backup not from a single point in time, correct?</p>
  
  <p><code>mongodump -h $MONGO_HOST:$MONGO_PORT -d $MONGO_DATABASE -o ./${EXPORT_FILE} -u backup -p password --authenticationDatabase admin</code></p>