Skip to content

Instantly share code, notes, and snippets.

@garnaat
Created May 24, 2010 13:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save garnaat/411851 to your computer and use it in GitHub Desktop.
Save garnaat/411851 to your computer and use it in GitHub Desktop.
Use boto to create an RRS Key in S3
# Create a new key in an S3 bucket and specify you want to use
# the Reduced Redundancy Storage (RRS) option of S3
import boto
# create connection to S3 service
s3 = boto.connect_s3()
# lookup my existing bucket
bucket = s3.lookup('mybucket')
# create a new, empty Key object in that bucket
key = bucket.new_key('rrskey')
# store the content of the key and specify you want to use RRS
key.set_contents_from_filename('/home/mitch/mylocalfile.txt', reduced_redundancy=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment