title: tar gzip mongo dump like MySQL
body: <p>Is there anyway to tar gzip mongo dumps like you can do with MySQL dumps?</p>
  
  <p>For example, for mysqldumps, you can write a command as such:</p>
  
  <pre><code>mysqldump -u &lt;username&gt; --password=&lt;password&gt; --all-databases | gzip &gt; all-databases.`date +%F`.gz
  </code></pre>
  
  <p>Is there an equivalent way to do the same for mongo dumps?</p>
  
  <p>For mongo dumps I run this command:</p>
  
  <pre><code>mongodump --host localhost --out /backup
  </code></pre>
  
  <p>Is there a way to just pipe that to gzip? I tried, but that didn't work. </p>
  
  <p>Any ideas?</p>