sh 检查S3铲斗尺寸

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 检查S3铲斗尺寸相关的知识,希望对你有一定的参考价值。

#!/bin/bash -e

function get_bucket_size() {
	aws s3api list-objects --bucket $1 --output json --query "[sum(Contents[].Size)]" | jq .[]/1073741824
}

for b in $@; do
	b_val=$(get_bucket_size $b)
	echo "Bucket $b is using ${b_val:0:4} GB"
done

以上是关于sh 检查S3铲斗尺寸的主要内容,如果未能解决你的问题,请参考以下文章