ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 205 - Associate Cloud Engineer discussion

Report
Export

The storage costs for your application logs have far exceeded the project budget. The logs are currently being retained indefinitely in the Cloud Storage bucket myapp-gcp-ace-logs. You have been asked to remove logs older than 90 days from your Cloud Storage bucket. You want to optimize ongoing Cloud Storage spend. What should you do?

A.
Write a script that runs gsutil Is -| -- gs://myapp-gcp-ace-logs/** to find and remove items older than 90 days. Schedule the script with cron.
Answers
A.
Write a script that runs gsutil Is -| -- gs://myapp-gcp-ace-logs/** to find and remove items older than 90 days. Schedule the script with cron.
B.
Write a lifecycle management rule in JSON and push it to the bucket with gsutil lifecycle set config-json-file.
Answers
B.
Write a lifecycle management rule in JSON and push it to the bucket with gsutil lifecycle set config-json-file.
C.
Write a lifecycle management rule in XML and push it to the bucket with gsutil lifecycle set config-xml-file.
Answers
C.
Write a lifecycle management rule in XML and push it to the bucket with gsutil lifecycle set config-xml-file.
D.
Write a script that runs gsutil Is -Ir gs://myapp-gcp-ace-logs/** to find and remove items older than 90 days. Repeat this process every morning.
Answers
D.
Write a script that runs gsutil Is -Ir gs://myapp-gcp-ace-logs/** to find and remove items older than 90 days. Repeat this process every morning.
Suggested answer: B

Explanation:

You write a lifecycle management rule in XML and push it to the bucket with gsutil lifecycle set config-xml-file. is not right.

gsutil lifecycle set enables you to set the lifecycle configuration on one or more buckets based on the configuration file provided. However, XML is not a valid supported type for the configuration file.

Ref:https://cloud.google.com/storage/docs/gsutil/commands/lifecycle

Write a script that runsgsutil ls -lr gs://myapp-gcp-ace-logs/**to find and remove items older than 90 days. Repeat this process every morning. is not right.

This manual approach is error-prone, time-consuming and expensive. GCP Cloud Storage provides lifecycle management rules that let you achieve this with minimal effort.

Write a script that runsgsutil ls -l gs://myapp-gcp-ace-logs/**to find and remove items older than 90 days. Schedule the script with cron. is not right.

This manual approach is error-prone, time-consuming and expensive. GCP Cloud Storage provides lifecycle management rules that let you achieve this with minimal effort.

Write a lifecycle management rule in JSON and push it to the bucket with gsutil lifecycle set config-json-file. is the right answer.

You can assign a lifecycle management configuration to a bucket. The configuration contains a set of rules which apply to current and future objects in the bucket. When an object meets the criteria of one of the rules, Cloud Storage automatically performs a specified action on the object. One of the supported actions is to Delete objects. You can set up a lifecycle management to delete objects older than 90 days. gsutil lifecycle set enables you to set the lifecycle configuration on the bucket based on the configuration file. JSON is the only supported type for the configuration file. The config-json-file specified on the command line should be a path to a local file containing the lifecycle configuration JSON document.

Ref:https://cloud.google.com/storage/docs/gsutil/commands/lifecycle

Ref:https://cloud.google.com/storage/docs/lifecycle

asked 18/09/2024
Peter Stones
39 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first