title: curl + ftp for directory containing files and directories
body: <p>I am trying to write a script that will help me upload a directory to a FTP location.</p>
  
  <p>The directory structure looks like so:</p>
  
  <pre><code>MasterDirectory/
      file1.jpg
      file2.jpg
      ChildDirectory/
          childFile.jpg
  </code></pre>
  
  <p>Ideally, I want to write a shell script that does the following:</p>
  
  <ul>
  <li><code>cd MasterDirectory/</code>   </li>
  <li>iterate through all contents</li>
  <li>if there is a file, upload that file with <code>curl -T filename</code> and FTP</li>
  <li>if there is a directory, upload that directory and all of its contents, including any subdirectories</li>
  </ul>
  
  <p>I am able to upload a single file with the command <code>curl -T filename.jpg ftp://ftp.server.com --user username:password</code> but past that, I am a bit lost. Can anyone show me what kind of script I would write to accomplish this?</p>
  
  <p>I want this script to run in the <code>after-success</code> node of a Travis CI job. I am not married to the idea of using a shell script, but this feels like the best way to do this. If anyone has a better idea for doing this with Travis CI, I am open to suggestion!</p>
  
  <p>Thank you so much in advance for any help you can provide!!!</p>