You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
..
README.md

README.md

存储桶生命周期配置快速入门指南 Slack Docker Pulls

在存储桶上启用对象的生命周期配置,可以设置在指定天数或指定日期后自动删除对象。

1. 前提条件

2. 启用存储桶生命周期配置

  • 创建一个存储桶的生命周期配置,该配置让前缀old/下的对象在2020-01-01T00:00:00.000Z过期,同时前缀temp/下的对象在7天后过期。
  • 使用mc启用存储桶的生命周期配置:
$ mc ilm import play/testbucket
{
    "Rules": [
        {
            "Expiration": {
                "Date": "2020-01-01T00:00:00.000Z"
            },
            "ID": "OldPictures",
            "Filter": {
                "Prefix": "old/"
            },
            "Status": "Enabled"
        },
        {
            "Expiration": {
                "Days": 7
            },
            "ID": "TempUploads",
            "Filter": {
                "Prefix": "temp/"
            },
            "Status": "Enabled"
        }
    ]
}

Lifecycle configuration imported successfully to `play/testbucket`.
  • 列出当前的设置
$ mc ilm list play/testbucket
     ID     |  Prefix  |  Enabled   | Expiry |  Date/Days   |  Transition  |    Date/Days     |  Storage-Class   |       Tags
------------|----------|------------|--------|--------------|--------------|------------------|------------------|------------------
OldPictures |   old/   |    ✓       |  ✓     |  1 Jan 2020  |     ✗        |                  |                  |
------------|----------|------------|--------|--------------|--------------|------------------|------------------|------------------
TempUploads |  temp/   |    ✓       |  ✓     |   7 day(s)   |     ✗        |                  |                  |
------------|----------|------------|--------|--------------|--------------|------------------|------------------|------------------

进一步探索