Using s3cmd.rb to copy files to/from Amazon

//

//

Examples
--------
List all the buckets your account owns:
	s3cmd.rb listbuckets

Create a new bucket:
	s3cmd.rb createbucket BucketName

Create a new bucket in the EU:
	s3cmd.rb createbucket BucketName EU

Find out the location constraint of a bucket:
   s3cmd.rb location BucketName

Delete an old bucket you don't want any more:
	s3cmd.rb deletebucket BucketName

Find out what's in a bucket, 10 lines at a time:
	s3cmd.rb list BucketName 10

Only look in a particular prefix:
	s3cmd.rb list BucketName:startsWithThis

Look in the virtual "directory" named foo;
lists sub-"directories" and keys that are at this level.
Note that if you specify a delimiter you must specify a max before it.
(until I make the options parsing smarter)
	s3cmd.rb list BucketName:foo/  10  /

Delete a key:
	s3cmd.rb delete BucketName:AKey

Delete all keys that match (like a combo between list and delete):
	s3cmd.rb deleteall BucketName:SomePrefix

Only pretend you're going to delete all keys that match, but list them:
	s3cmd.rb  --dryrun  deleteall  BucketName:SomePrefix

Delete all keys in a bucket (leaving the bucket):
	s3cmd.rb deleteall BucketName

Get a file from S3 and store it to a local file
	s3cmd.rb get BucketName:TheFileOnS3.txt  ALocalFile.txt

Put a local file up to S3
Note we don't automatically set mime type, etc.
NOTE that the order of the options doesn't change. S3 stays first!
	s3cmd.rb put BucketName:TheFileOnS3.txt ALocalFile.txt

Example to retrieve a file:

/home/s3sync/s3cmd.rb get server1.3mwhosting.com:backup/bak_2014_01_09_04_41_23/bak-1-tar-2014-1-9/backup.tar.gzaa backup.tar.gzaa

Source: http://s3.amazonaws.com/ServEdge_pub/s3sync/README_s3cmd.txt