Report this

What is the reason for this report?

Is LifecycleConfiguration working on DigitalOcean Spaces?

Posted on March 19, 2021

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



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.