How do I synchronize sites/default/files wtith a AmazonS3 bucket? I need to sync sites/defalut/files with a amazons3 bucket. I found the AmazonS3 module, which replaces the storage location, while I still want to use the files at sites/defalut/files.

I want to use AmazonS3 as a sort of backup, and not as a storage solution. The files will not be served from it.

How can I do this?

I also found the Storage API module.
If the need is to occasionally copy files from a directory to a corresponding directory on S3, you can use S3 CLI from AWS.

It provides a recursive copy:
aws s3 cp /tmp/foo s3://bucket/ --recursive


Reference: s3 — AWS CLI 1.2.13 documentation : http://docs.aws.amazon.com/cli/latest/reference/s3/

I programatically called this once using the shell-exec from python and invoking the CLI commands. 

The long route require the use of AWS S3 REST API (or one of the client SDKs). I havent done this myself, but it is possible since the CLI itself is implemented this way. May be you can take a look at the CLI code on github