title: How to use mysqldump, pv, and zip command together?
body: <p>I want to use <code>mysqldump</code> to get a table from a remote MySQL server, then compress this downloaded file using <code>zip</code>. While downloading, I wish I can view the progress using <code>pv</code>.</p>
  
  <p>Can I do the above things with <code>|</code> in one line of command?</p>
  
  <p>These are what I've tried:</p>
  
  <pre><code>mysqldump -uuser_name -ppassword -hremote_address --routines my_database my_table | pv | zip &gt; my_database_my_table.sql.zip
  </code></pre>
  
  <p>The problem with this command is that when executing <code>unzip my_database_my_table.sql.zip</code>, I got <code>-</code> as the name of the output file. I wish I could determine the file's name when I execute <code>zip</code> command.</p>
  
  <p>Is it possible to set the name of the inflated file?</p>
  
  <pre><code>mysqldump -uuser_name -ppassword -hremote_address --routines my_database my_table | pv | zip my_database_my_table.sql &gt; my_database_my_table.sql.zip
  </code></pre>
  
  <p>This command gives me <code>mysqldump: Got errno 32 on write</code> error.</p>