I was trying to change storage class of a set of existing objects (over 300 GBs) as advised in this post:
I tried it on one file first:
fyn@pod-arch:~$ gsutil ls -L gs://some-bucket/sub-dir/audioArch.mp3
gs://some-bucket/sub-dir/audioArch.mp3:
Creation time: Fri, 29 Jul 2016 00:52:51 GMT
Update time: Fri, 05 Aug 2016 15:40:51 GMT
Storage class: DURABLE_REDUCED_AVAILABILITY
Content-Language: en
Content-Length: 43033404
Content-Type: audio/mpeg
... ...
fyn@pod-arch:~$ gsutil -m rewrite -s coldline gs://some-bucket/sub-dir/audioArch.mp3
- [1/1 files][ 41.0 MiB/ 41.0 MiB] 100% Done
Operation completed over 1 objects/41.0 MiB.
fyn@pod-arch:~$ gsutil ls -L gs://some-bucket/sub-dir/audioArch.mp3
gs://some-bucket/sub-dir/audioArch.mp3:
Creation time: Sun, 30 Oct 2016 23:49:34 GMT
Update time: Sun, 30 Oct 2016 23:49:34 GMT
Storage class: COLDLINE
Content-Language: en
Content-Length: 43033404
Content-Type: audio/mpeg
... ...
Then I tried it on 15 more, and then on the rest of the objects in a subdir... Works like a charm ☺, although the operation overwrites the Creation & Update times!
I had two follow-up queries though:
- Is
gsutil rewrite
operation billable? - Can Creation time be preserved?
Many thanks.
Cheers!
fynali