Report this

What is the reason for this report?

Unable to Sync to S3 with s3cmd

Posted on May 23, 2015

After setting up s3cmd and my S3 bucket, when I try this command

sudo s3cmd sync --recursive --preserve /srv s3://MyS3Bucket

I get this error:

ERROR: S3 error: 400 (InvalidRequest): The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.

My s3cmd version is 1.0.0 which is installed by default after following their “deb” installation guide for by Ubuntu 12.04



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I’m running it through ROOT only.

Anyting other than this that you feel could be affecting the script usage?

Another issue now is setting up cron to automate the backup script.

While the commands are working with s3cmd tool when run one by one directly from command line, however when I created a .sh script, and trying to run through cron, the script runs fine but shows below error:

ERROR: S3 error: 400 (InvalidRequest): The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.

My .sh file is as follows:

#!/bin/sh
echo 'Started'
date +'%a %b %e %H:%M:$S %Z %Y'
s3cmd sync --recursive --preserve /srv s3://MyBucket
s3cmd sync --recursive --preserve /etc s3://MyBucket
s3cmd sync --recursive --preserve /home s3://MyBucket
s3cmd sync --recursive --preserve /var s3://MyBucket
dpkg --get-selections >> dpkg.list 2>&1
s3cmd sync --recursive --preserve dpkg.list s3://MyBucket
date +'%a %b %e %H:%M:$S %Z %Y'
echo 'Finished'

Any suggestions for this?

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.