Google Cloud Professional Cloud Architect — Question 48
You are creating a solution to remove backup files older than 90 days from your backup Cloud Storage bucket. You want to optimize ongoing Cloud Storage spend.
What should you do?
Answer options
- A. Write a lifecycle management rule in XML and push it to the bucket with gsutil
- B. Write a lifecycle management rule in JSON and push it to the bucket with gsutil
- C. Schedule a cron script using gsutil ls ג€"lr gs://backups/** to find and remove items older than 90 days
- 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
Correct answer: B
Explanation
The correct answer is B because a lifecycle management rule in JSON format is the appropriate way to automate the deletion of files based on their age in Cloud Storage. Option A is incorrect as XML is not supported for lifecycle rules. Options C and D involve manual file deletion which doesn't optimize storage costs as effectively as using lifecycle rules.