How To Set Name Of Target Folder on S3 with s3cmd
<p>I have a server that holds 3 websites and I have the following bash script that will run the <code>s3cmd sync</code> command daily:</p>

<pre><code>#!/bin/sh
echo 'Started'
date +'%a %b %e %H:%M:%S %Z %Y'
s3cmd sync --recursive --preserve /etc/apache2 s3://mybucket
s3cmd sync --recursive --preserve /var/www/website1.com/public_html s3://mybucket
s3cmd sync --recursive --preserve /var/www/website2.com/public_html s3://mybucket
s3cmd sync --recursive --preserve /var/www/website3.com/public_html s3://mybucket
s3cmd sync --recursive --preserve /var/db_backups s3://mybucket
dpkg --get-selections &gt; dpkg.list
s3cmd sync --recursive --preserve dpkg.list s3://mybucket
date +'%a %b %e %H:%M:%S %Z %Y'
echo 'Finished'
</code></pre>

<p>The problem though is that the <code>s3cmd sync</code> command creates the <code>public_html</code> folder and puts all of the 3 websites in to that folder.</p>

<p>What I want to do is have the three sites back up in to separate folders. How can I achieve this with the above commands?</p>