title: Exclude sub-folder for Sync to AmazonS3 using s3cmd
body: <p>I am using the following command with s3cmd to sync a wordpress wp-content folder to S3</p>
  
  <pre><code>/usr/bin/s3cmd sync -r --delete-removed --add-header "Cache-Control:max-age=31536000" /home/USERNAME/public_html/wp-content/ s3://www.mydomainBucketName.com/wp-content/
  </code></pre>
  
  <p>However I want to exclude a sub-folder from being synced as it is just not necessary to have on S3. The sub folder is:</p>
  
  <pre><code>/home/USERNAME/public_html/wp-content/uploads/backupbuddy_backups
  </code></pre>
  
  <p>I have looked at the thread at <a href="https://stackoverflow.com/questions/21891045/exclude-folders-for-s3cmd-sync">Exclude folders for s3cmd sync</a> however it gave me a starting idea, but it is not working.</p>
  
  <p>This is the new s3cmd that I'm tried which is not working:</p>
  
  <pre><code>/usr/bin/s3cmd sync -r --exclude "home/USERNAME/public_html/wp-content/uploads/backupbuddy_backups/*" --delete-removed --add-header "Cache-Control:max-age=31536000" /home/USERNAME/public_html/wp-content/ s3://www.mydomainBucketName.com/wp-content/
  </code></pre>
  
  <p>I also tried adding a / in the exclude statement so it was: --exclude "/home but that did not work either.</p>
  
  <p>I have reviewed the exclude docs at <a href="http://s3tools.org/s3cmd-sync" rel="nofollow noreferrer">http://s3tools.org/s3cmd-sync</a> but I am coming up blank. Appreciate some assistance :)</p>