title: Zip folders and files recursivly SSH
body: <p>I'm trying to make a script that will zip and download wordpress plugins from the staging environment via SSH and unpack them locally.</p>
  
  <p>I am using PHPSecLib for this.</p>
  
  <p>Now when i'm connected to the server and execute this command:</p>
  
  <pre><code>cd /path/to/wp-content/plugins &amp;&amp; zip -r plugins.zip *
  </code></pre>
  
  <p>A file is indeed created, however it has no extension, and it has the wrong name.</p>
  
  <p>When i try this:</p>
  
  <pre><code>cd /path/to/wp-content/plugins &amp;&amp; zip plugins.zip *
  </code></pre>
  
  <p>a plugins.zip is created, with all the all the files and folders from the plugin directory, however every plugin folder is empty.</p>
  
  <p>Some of the output i get when running the 1st command:</p>
  
  <pre><code>adding: wp-super-cache/languages/wp-super-cache-tr_TR.po (deflated 70%)
  adding: wp-super-cache/languages/wp-super-cache-zh_CN.mo (deflated 61%)
  adding: wp-super-cache/languages/wp-super-cache-ru_RU.po (deflated 72%) 
  </code></pre>
  
  <p>About every file shows up in the output.</p>
  
  <p>Could someone point me into the right direction ?</p>