Created
September 7, 2018 13:47
-
-
Save alastairhm/f177aa1b6814fdf89a949d5130729b9c to your computer and use it in GitHub Desktop.
Restore S3 objects which have been moved to glacier storage.
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
export MYBUCKET=mybucket | |
export MYDIR=mydir/1/ | |
aws s3 ls s3://$MYBUCKET/$MYDIR/ | awk '{if ($4) print $4}' > myFiles.txt | |
for x in `cat myFiles.txt` | |
do | |
echo "restoring $x" | |
aws s3api restore-object \ | |
--bucket $MYBUCKET \ | |
--key "${MYDIR}/$x" \ | |
--restore-request '{"Days":7}' | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment