Skip to content

Instantly share code, notes, and snippets.

View axos88's full-sized avatar

Akos Vandra-Meyer axos88

View GitHub Profile
@axos88
axos88 / download_all.sh
Last active March 20, 2018 14:40
Download all versions of a specific object in S3
echo "Usage - $0 BUCKET KEY SUFFIX BATCH_SIZE"
BUCKET=$1
KEY=$2
SUFFIX=$3
BATCH=${4:- 25}
echo "Querying versions..."
VERSIONS=$(aws s3api list-object-versions --bucket $1 --prefix $2 | jq '.Versions[].VersionId' -r)