#!/bin/bash BUCKET=$1 aws s3 ls s3://$BUCKET --recursive | awk '{print $NF}' | while read i; do aws s3api restore-object --bucket $BUCKET --key $i --restore-request Days=20 done