Created
April 22, 2019 20:32
-
-
Save so-jelly/f91830555e36a6cc90d5b9521b3b52d3 to your computer and use it in GitHub Desktop.
GCS bucket version and lifecycle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"lifecycle": { | |
"rule": [{ | |
"action": { | |
"type": "Delete" | |
}, | |
"condition": { | |
"numNewerVersions": 14 | |
} | |
}] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
BUCKET=changeme | |
gsutil versioning set on gs://${BUCKET} | |
gsutil lifecycle set lifecycle.json gs://${BUCKET} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment