Is there an option to delete the incomplete multipart uploads after X days?.

February 26, 2018 753 views
Object Storage Ubuntu 16.04
1 Answer

Yes. While this functionality has not been exposed in the control panel yet, the Spaces API supports using lifecycle rules to delete incomplete multipart uploads. For example, using AWS cli, you can configure a rule like so:

$ aws s3api --endpoint-url=https://nyc3.digitaloceanspaces.com \
    put-bucket-lifecycle-configuration \
    --bucket example-space \
    --lifecycle-configuration \
    file://lifecycle.json


Where the contents of lifecycle.json look like:

{
    "Rules": [
        {
            "ID": "Remove uncompleted uploads",
            "Status": "Enabled",
            "Prefix": "",
            "AbortIncompleteMultipartUpload": {
                "DaysAfterInitiation": 1
            }
        }
    ]
}
  • @asb It seems that this is slightly incorrect. The --endpoint-url param should also include the bucket name, eg --endpoint-url=https://my-bucket.nyc3.digitaloceanspaces.com

Have another answer? Share your knowledge.