Question

Is LifecycleConfiguration working on DigitalOcean Spaces?

Posted March 19, 2021 295 views
DigitalOcean Spaces

Hi,

I have about 16mil files (1 TB total) in DO space and I wanted to set expiration policy to delete all files older than 40 days. According to docs, DO Spaces should support LifecycleConfiguration, so that I set it for bucket using s3cmd:

s3cmd expire  s3://mybucket --expiry-days 40

The command was accepted and the rule was set:

s3cmd getlifecycle  s3://mybucket

<?xml version="1.0" ?>
<LifecycleConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <Rule>
        <ID>bqwrg54gdyz5sn8gwkq9c6yqlcdvmalfkelpg82u6vl1nhrs</ID>
        <Prefix/>
        <Status>Enabled</Status>
        <Expiration>
            <Days>40</Days>
        </Expiration>
    </Rule>
</LifecycleConfiguration>

However, 2 months passed and I checked the bucket again and I still can see files older than half year. So is this feature working? Is it limited to some specific datacenter or so?

Thanks,

Jindrich

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.

×
Submit an Answer
1 answer

I set like

<LifecycleConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <Rule>
        <ID>Expire 180</ID>
        <Prefix></Prefix>
        <Status>Enabled</Status>
        <Expiration>
            <Days>180</Days>
        </Expiration>
    </Rule>

    <Rule>
        <ID>Remove uncompleted uploads</ID>
        <Status>Enabled</Status>
        <Prefix/>
        <AbortIncompleteMultipartUpload>
            <DaysAfterInitiation>1</DaysAfterInitiation>
        </AbortIncompleteMultipartUpload>
    </Rule>
</LifecycleConfiguration>

s3cmd setlifecycle do_s3.xml s3://mybucket

ref: https://developers.digitalocean.com/documentation/spaces/#create-bucket-lifecycle