Created
May 24, 2010 13:23
-
-
Save garnaat/411851 to your computer and use it in GitHub Desktop.
Use boto to create an RRS Key in S3
This file contains hidden or 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
# 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