Skip to content

Instantly share code, notes, and snippets.

@wyllie
Created November 16, 2018 16:55
Show Gist options
  • Save wyllie/8c991a457db087afcf762d5e42da8e72 to your computer and use it in GitHub Desktop.
Save wyllie/8c991a457db087afcf762d5e42da8e72 to your computer and use it in GitHub Desktop.
#!/bin/sh
BUCKETNAME=$1
echo Checking: $BUCKETNAME
echo Size of objects, number of objects
set result=`aws s3api list-objects --bucket $BUCKETNAME --output json --query "[sum(Contents[].Size), length(Contents[])]"`
echo Number of Objects: $3
echo Size of Objects: $2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment