更改Google云端存储中(现有)对象的存储类别 [英] Change storage class of (existing) objects in Google Cloud Storage
问题描述
美好的一天!
我最近了解到了 Google云端存储平台/服务中宣布的新存储层级和降低价格。
因此,我想将我的一个存储区的默认存储类别从持久性降低可用性更改为 Coldline 这是适合我在那个桶中归档的文件。
我收到了这个提示:
更改默认存储类只会影响您添加到
的对象。它不会更改存储桶中已存在的
对象的存储类。
有关我如何使用的任何建议/提示可以更改存储桶中所有现有对象的类(使用云控制台或 gsutil
)?
欣赏它;谢谢
干杯!
将对象同步移动到同一个存储桶中不同存储类的最简单方法是使用重写。例如,要使用gsutil执行此操作,您可以运行:
gsutil -m rewrite -s coldline gs:// your-桶/ **
注意:确保gsutil是最新版本(版本4.22及以上版本支持 -s
标志与 rewrite
)。
或者,您可以使用生命周期管理中的新< CreatedBefore
条件默认存储类)。
Good day!
I recently learnt of the new storage tiers and reduced prices announced on the Google Cloud Storage platform/service.
So I wanted to change the default storage class for one of my buckets from Durable Reduced Availability to Coldline, as that is what is appropriate for the files that I'm archiving in that bucket.
I got this note though:
Changing the default storage class only affects objects you add to this bucket going forward. It does not change the storage class of objects that are already in your bucket.
Any advice/tips on how I can change class of all existing objects in the bucket (using cloud console or gsutil
)?
Appreciate it; thanks
Cheers!
fynali
The easiest way to synchronously move the objects to a different storage class in the same bucket is to use rewrite. For example, to do this with gsutil, you can run:
gsutil -m rewrite -s coldline gs://your-bucket/**
Note: make sure gsutil is up to date (version 4.22 and above support the -s
flag with rewrite
).
Alternatively, you can use the new SetStorageClass
action of the Lifecycle Management feature to asynchronously (usually takes about 1 day) modify storage classes of objects in place (e.g. by using a CreatedBefore
condition set to some time after you change the bucket's default storage class).
这篇关于更改Google云端存储中(现有)对象的存储类别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!