Skip to content

Instantly share code, notes, and snippets.

@j1n6
Created March 23, 2015 14:56
Show Gist options
  • Save j1n6/ff453b82b7308bc4640b to your computer and use it in GitHub Desktop.
Save j1n6/ff453b82b7308bc4640b to your computer and use it in GitHub Desktop.
recursively restore glacier file for a path
# 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