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 | |
s3 = boto3.resource('s3') | |
bucket = s3.Bucket('glacier-bucket') | |
for obj_sum in bucket.objects.all(): | |
obj = s3.Object(obj_sum.bucket_name, obj_sum.key) | |
if obj.storage_class == 'GLACIER': | |
# Try to restore the object if the storage class is glacier and | |
# the object does not have a completed or ongoing restoration | |
# request. |