Skip to content

Instantly share code, notes, and snippets.

@mknkisk
Last active April 18, 2020 18:27
Show Gist options
  • Save mknkisk/e27e89ddf89c95bff51befd7ee5f4509 to your computer and use it in GitHub Desktop.
Save mknkisk/e27e89ddf89c95bff51befd7ee5f4509 to your computer and use it in GitHub Desktop.
aws glacier -> aws s3
for key in `aws s3api list-objects --bucket {bucket_name} --output json | jq -r '.Contents[].Key'`; do echo $key; aws s3api restore-object --bucket {bucket_name} --key $key --restore-request '{"Days": 1}'; done
for key in `aws s3api list-objects --bucket {bucket_name} --output json | jq -r '.Contents[].Key'`; do echo "\n$key"; aws s3api head-object --bucket {bucket_name} --key $key --output json | jq -r .Restore; done
for key in `aws s3api list-objects --bucket {bucket_name} --prefix {path} --output json | jq -r '.Contents[].Key'`; do echo "\n$key"; aws s3 cp s3://{bucket_name}/$key ./; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment