1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

google cloud storage バージョン管理 lifecycle の設定

Posted at

原稿データのバックアップに google cloud storage のバケットを使っていて
ライフサイクルルールを再検討したので記事にしました

バケットのバージョン管理オン

$ gsutil versioning set on gs://bucket-name

ライフサイクルのセット

$ gsutil lifecycle set lifecycle.json gs://bucket-name

ライフサイクルルールファイル(lifcycle.json)の内容
3個前のバージョンは自動削除、60日経過した古いバージョンも自動削除

{
"lifecycle": {
  "rule": [
  {
    "action": {"type": "Delete"},
    "condition": {
      "NumberOfNewerVersions": 2,
      "isLive": false
    }
  },
  {
    "action": {"type": "Delete"},
    "condition": {
      "age": 60,
      "isLive": false
    }
  }
]
}
}
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?