Created
May 24, 2010 13:58
-
-
Save garnaat/411893 to your computer and use it in GitHub Desktop.
Use boto to copy an S3 key to an RRS key
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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