-
[ AWS ] boto3를 이용한 Bucket Size 구하기카테고리 없음 2022. 2. 26. 04:19
import boto3 s3 = boto3.resource('s3') bucket = s3.Bucket('mybucket') sizes = 0 for i in bucket.objects.all(): sizes += i.size print(sizes)
Output :
7929413
import boto3
s3 = boto3.resource('s3')
bucket = s3.Bucket('mybucket')
sizes = 0
for i in bucket.objects.all():
sizes += i.size
print(sizes)
Output :
7929413