#!/bin/bash echo "Object key must not start with /" BUCKET=$1 # Restore objects cat /tmp/objectlist.txt | parallel -v -j8 aws s3api restore-object --bucket $BUCKET --key {} --restore-request Days=20 # Check restore status. ongoing-request="true" will be returned if it's in progress cat /tmp/objectlist.txt | parallel -j8 aws s3api head-object --bucket $BUCKET --key {} --query Restore --output text | sort | uniq -c # After objects are restored, use aws s3 sync with --force-glacier-transfer to download objects