
Answer-first summary for fast verification
Answer: Write a lifecycle management rule in JSON and push it to the bucket with `gsutil`
The correct answer is B because Cloud Storage supports automatically managing the lifecycle of objects using a JSON document that defines the rules. This method is efficient and directly supported by `gsutil`. Option A is incorrect because XML is not supported by `gsutil` for lifecycle configurations; it only works with direct REST APIs. Options C and D are not recommended because manually listing objects, calculating their age, and then deleting them is cumbersome and less efficient than using lifecycle management rules.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
To optimize ongoing Cloud Storage spend by removing backup files older than 90 days from your backup Cloud Storage bucket, which approach should you take?
A
Schedule a cron script using gsutil ls -lr gs://backups/** to find and remove items older than 90 days
B
Write a lifecycle management rule in JSON and push it to the bucket with gsutil
C
Write a lifecycle management rule in XML and push it to the bucket with gsutil
D
Schedule a cron script using gsutil ls -l gs://backups/** to find and remove items older than 90 days and schedule it with cron