Created
May 24, 2010 15:21
-
-
Save garnaat/411994 to your computer and use it in GitHub Desktop.
Use boto to convert an S3 key to RRS
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
# Convert an existing key in an S3 bucket that uses the STANDARD storage class | |
# to one using the REDUCED_REDUNDANCY storage class. This uses the S3 COPY | |
# command to copy the key back to the same bucket. The ACL is preserved. | |
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('myoldkey') | |
# change the storage_class of the key from STANDARD to REDUCED_REDUNDANCY | |
key.change_storage_class('REDUCED_REDUNDANCY') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment