Created
March 23, 2015 14:56
-
-
Save j1n6/ff453b82b7308bc4640b to your computer and use it in GitHub Desktop.
recursively restore glacier file for a path
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
# You might get a couple of errors: | |
# 1. This is not Glacier type | |
# Restore is not allowed, as object's storage class is not GLACIER | |
# 2. Already requested | |
# Object restore is already in progress | |
# 3. This is a path object | |
# The specified key does not exist. | |
for key in `aws s3 ls --recursive s3://{BUCKET}/{PATH} | awk '{ print $4}'` ; do echo "==> $key"; aws s3api restore-object --bucket {BUCKET} --key $key --restore-request '{"Days": 1}' ; done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment