Question

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

Posted February 26, 2018 3.6k views
Ubuntu 16.04Object Storage

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
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://bucket-name.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
            }
        }
    ]
}
edited by eris
  • @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

Submit an Answer