Skip to content

Instantly share code, notes, and snippets.

@garnaat
Created May 24, 2010 13:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save garnaat/411893 to your computer and use it in GitHub Desktop.
Save garnaat/411893 to your computer and use it in GitHub Desktop.
Use boto to copy an S3 key to an RRS key
# Copy an existing key in an S3 bucket and specify you want to use
# the Reduced Redundancy Storage (RRS) option of S3 for the new copy
import boto
# create connection to S3 service
s3 = boto.connect_s3()
# lookup my existing bucket
bucket = s3.lookup('mybucket')
# lookup the Key you want to copy in the bucket
key = bucket.lookup('nonrrskey')
# create a copy of the key in the same bucket and specify you want to use RRS
key.copy(key.bucket.name, 'rsskey', reduced_redundancy=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment