
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. Google's Cloud Storage lifecycle management rules allow you to specify conditions to automatically delete objects based on criteria such as age. These rules are typically written in JSON format and can be pushed to the bucket using the gsutil command. Option A is incorrect because lifecycle management rules are not written in XML for this use case. Options C and D involve using cron scripts to manually find and delete files, which is not as efficient or cloud-native as using built-in lifecycle management rules. Hence, JSON with gsutil (Option B) is the most appropriate and efficient solution.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You are managing a Cloud Storage bucket used for storing backup files. To control costs, you need to implement a solution that will automatically remove backup files older than 90 days. What should you do?
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
No comments yet.