title: Mongodump with --oplog for hot backup
body: <p>I'm looking for the right way to do a Mongodb backup on a replica set (non-sharded).</p>
  
  <p>By reading the Mongodb documentation, I understand that a "mongodump --oplog" should be enough, even on a replica (slave) server.</p>
  
  <p><a href="http://docs.mongodb.org/manual/reference/program/mongodump/#bin.mongodump" rel="nofollow">From the mongodb / mongodump documentation : </a> </p>
  
  <blockquote>
    <p>--oplog
    Use this option to ensure that mongodump creates a dump of the database that includes an oplog, to create a point-in-time snapshot of the state of a mongod instance. To restore to a specific point-in-time backup, use the output created with this option in conjunction with mongorestore --oplogReplay.</p>
    
    <p>Without --oplog, if there are write operations during the dump operation, the dump will not reflect a single moment in time. Changes made to the database during the update process can affect the output of the backup</p>
  </blockquote>
  
  <p>I'm still having a very hard time to understand how Mongodb can backup and keep writing on the database and make a consistent backup, even with --oplog.
  Should I lock my collections first or is it safe to run "mongodump --oplog ?
  Is there anything else I should know about?</p>
  
  <p>Thanks.</p>