How to retrieve the size of all my Google Cloud St

2019-07-11 07:40发布

问题:

Is there a quick way to retrieve all the sizes of each of my Google Cloud Storage bucket?

We do not see the size in the UI. I have to do:

gsutil du -s -h gs://xxxx

for each bucket.

回答1:

GCS does not provide this as a feature. What you're doing is likely the fastest way.

You could write a program to dynamically track the size of a bucket by watching change notifications, or you could use Cloud Storage's daily storage logs to get regular reports on it, but there's no instant way to see the current size.



回答2:

I had a similar issue and found you can run the following command to find the size of all the buckets within your project. Just replace project-id with your own.

gsutil -o GSUtil:default_project_id=project-id du -shc