title: how to zip the output of the mysqldump command?
body: <p>I have a cron with</p>
  
  <pre><code>#!/bin/sh
  
  #string representation for current day
  day=$(date +%Y%m%d)
  
  #archive db content
  /usr/bin/mysqldump --opt --host=db_host --user=db_user --password=db_pass db_name | /bin/gzip -c -9 &gt; ${day}_db_name.gz
  </code></pre>
  
  <p>which runs just fine.
  However, I would like to create a zip file instead using the zip compression.</p>
  
  <p>I tried with</p>
  
  <pre><code>/usr/bin/mysqldump --opt --host=db_host --user=db_user --password=db_pass db_name | zip -q -9 &gt; ${day}_db_name.zip
  </code></pre>
  
  <p>and the result is an archive with a file named "<strong>-</strong>" inside.
  My question is how can I change that name into something like the previous command generated, <strong>20130725_db_name</strong>?</p>
  
  <p>It says <a href="http://manpages.ubuntu.com/manpages/lucid/man1/zip.1.html" rel="nofollow">here</a> something about zip and input and pipeing and "Streaming input and output" but, unfortunately, that's too much for me to understand</p>