easyMultiple ChoiceObjective-mapped
Google ACE Practice Question: The company wants to change the storage class of…
Exhibit
Refer to the exhibit.
$ gsutil ls -L gs://my-bucket/logs/
...
Objects:
gs://my-bucket/logs/2023-01-01.log:
Storage class: ARCHIVE
Content-Type: text/plain
gs://my-bucket/logs/2023-01-02.log:
Storage class: ARCHIVE
Content-Type: text/plain
Total: 2 objects, 250 MBThe company wants to change the storage class of these log files to Nearline to reduce costs while still retaining the ability to access them without restoration fees. Which command should be used?
⚠ Common exam trap
Test-takers frequently confuse `gsutil rewrite` with `gsutil cp` or `gsutil mv`, assuming any command with `-s` can change storage class, but only `rewrite` avoids restoration fees by modifying the object in place without creating a new copy.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
gsutil rewrite -s NEARLINE gs://my-bucket/logs/*.log
The `gsutil rewrite` command is specifically designed to change the storage class of existing objects without incurring restoration fees. It rewrites the object metadata to the new storage class (Nearline) while keeping the object in place, and the operation does not require retrieving the object from cold storage, so no restoration charges apply.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
gsutil cp -s NEARLINE gs://my-bucket/logs/*.log
Why it's wrong here
The `gsutil cp` command is an object copy operation, not a storage-class modifier. When you run `gsutil cp -s NEARLINE gs://my-bucket/logs/*.log`, it attempts to copy each log to a destination with the NEARLINE class, but it leaves the original objects completely untouched—their storage class remains whatever it was. If the destination path is the same as the source (as written here), Cloud Storage will refuse to copy an object onto itself, so the command either fails or does nothing meaningful. Changing the storage class of existing objects requires a server-side rewrite, not a copy.
- ✓
gsutil rewrite -s NEARLINE gs://my-bucket/logs/*.log
Why this is correct
`gsutil rewrite -s NEARLINE gs://my-bucket/logs/*.log` is the correct command because it performs a server-side rewrite of each log object, replacing the object's storage class with NEARLINE while preserving the exact same object URI, generation, and content. The rewrite operation is designed specifically to update immutable properties like storage class or encryption key in place, without a local download/upload cycle or creating a duplicate object. For the task of changing storage class on multiple existing logs, this is the only option that directly and safely updates the original objects.
- ✗
gsutil setmeta -s NEARLINE gs://my-bucket/logs/*.log
Why it's wrong here
The `gsutil setmeta` command only updates custom metadata headers on an object, such as `Cache-Control` or user-defined metadata; it does not recognize a `-s` flag for storage class, and storage class is not a user-settable metadata property anyway. Even if you correctly invoked `setmeta` with valid headers, the object's storage class would remain completely unchanged—it is a separate system property that cannot be modified via metadata editing. Because the command neither accepts the provided `-s NEARLINE` flag nor has the ability to alter storage class, it is not a valid way to achieve the desired change.
- ✗
gsutil mv -s NEARLINE gs://my-bucket/logs/*.log
Why it's wrong here
`gsutil mv` is a move operation that works by copying each object to its destination and then deleting the original; it is not an in-place rewrite. When you specify `-s NEARLINE`, the storage class is applied only to the newly copied object at the destination, while the original object (if not deleted) retains its old class—and if the destination is the same as the source, as in this command, the move is either a no-op or an error because Cloud Storage will not allow an object to be moved onto itself. Even if it did succeed, it would create a new object and delete the old one, which is not the same as changing the storage class of the existing object. The intended in-place storage-class update is accomplished with `gsutil rewrite`, not `mv`.
Quick reference
AWS S3 Storage Class Comparison
| Storage Class | Min Duration | Retrieval | Use Case |
|---|---|---|---|
| S3 Standard | None | Immediate | Frequently accessed data |
| S3 Standard-IA | 30 days | Immediate | Infrequent access, rapid retrieval |
| S3 One Zone-IA | 30 days | Immediate | Non-critical infrequent data |
| S3 Intelligent-Tiering | None | Immediate–hours | Unknown or changing access patterns |
| S3 Glacier Instant | 90 days | Milliseconds | Archive with instant retrieval |
| S3 Glacier Flexible | 90 days | Minutes–hours | Archive, flexible retrieval |
| S3 Glacier Deep Archive | 180 days | Hours | Long-term compliance archive |
Go deeper
Related to this question
About these practice questions
Courseiva writes every ACE question from scratch — 769 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This ACE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the ACE exam.