Skip to content

Instantly share code, notes, and snippets.

View rodrigoacastro's full-sized avatar

Rodrigo Araújo e Castro rodrigoacastro

View GitHub Profile
@rodrigoacastro
rodrigoacastro / ls-s3-sizes.sh
Created June 4, 2021 21:17 — forked from colebrooke/ls-s3-sizes.sh
Quickly list sizes of AWS S3 buckets without traversing all objects.
#!/bin/bash
# Justin Miller 12/01/17
# Script to calculate the human readable size of S3 buckets
# The script uses cloudwatch metrics. These may need time to update if you've added data to a bucket within 24hrs.
# It happily DOES NOT need to travese potentially millions of files to calculate your S3 bucket sizes.
#
# Usage:
# ./ls-s3-sizes.sh
#
# TODO: Could be further parameterised depending on usage requirements.