Here’s a little script that uses s3cmd and calculate the total data size stored in all S3 buckets for the same account.
#!/bin/bash
for bucket in $(s3cmd ls |awk '{print $3}'); do
size=$(s3cmd du ${bucket} |awk '{print $1}')
total=$(expr $total + $size);
#echo $total
done
echo "total=$total kb"
Enjoy, Lahav