Contabo's S3 Object Storage supports S3 lifecycle policies that allow you to automatically delete objects after a set amount of time. This might be useful for pruning old backups or log files.
Lifecycle policies can be set through aws cli. Make sure to have it set up with your account before you begin. First, you'll need to define the policy as a json file. Here is an example how to delete all files inside a buckup after one year:
Adjust this snippet to your needs and save it as
lifecycle-policy.json on your local machine. Then apply to a bucket with aws cli like this:
aws --profile eu2 --region default --endpoint-url https://eu2.contabostorage.com s3api put-bucket-lifecycle-configuration --bucket test --lifecycle-configuration file://lifecycle-policy.json
Replace the profile and endpoint with your object storage and replace
test with the actual bucket name.
Be careful setting up lifecycle policies. They apply to all objects inside a bucket, irreversibly deleting them if configured so.
Tools like Cyberduck are making these tasks very easy. Just do a
Info on a bucket and check
Delete files in the
Lifecycle section at the bottom.