Created
December 10, 2020 02:13
-
-
Save holypriest/1b43de8efd9f87a613e2e22200e8ea82 to your computer and use it in GitHub Desktop.
Don't even start...
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
import boto3 | |
sess = boto3.session.Session(region_name='us-east-1') | |
s3res = sess.resource('s3') | |
gazillion_files = [('my-source-bucket', 'file-000000000001'), ...] | |
for f in gazillion_files: | |
copy_source = { | |
'Bucket': f[0], | |
'Key': f[1] | |
} | |
s3res.meta.client.copy( | |
CopySource=copy_source, | |
Bucket='my-destination-bucket', | |
Key=f[1], | |
ExtraArgs={'StorageClass': 'GLACIER'} | |
) | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment