Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import boto3
- import os
- s3 = boto3.resource('s3')
- bucket = s3.Bucket(BUCKET_NAME)
- os.chdir(DIRECTORY)
- for filename in os.listdir('.'):
- bucket.put_object(
- Key = filename,
- Body = open(filename, 'rb')
- )
- print 'Backed up ' + filename
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement