Coolify BackBlaze B2 retention

Coolify provides a way to locally set the retention for backups (how many copies to store):

Coolify retain last 7 backups

The problem with this is that it only applies to the local backups, stored in your Coolify instance, and not to the remote S3 backups.

Without any retention policies, your S3 will retain all backups, so over-time you will have huge amounts of data stored that will incur huge monthly costs.

Solution:

One easy solution is to use the Lifecycle settings in your S3 bucket. To automatically deleted old backups in BackBlaze:

  1. Login into your BackBlaze account.
  2. Go to Buckets
  3. There, choose your Coolify backup bucket and access "Lifecycle Settings":
  1. Select the "Custom lifecycle rules:" radio option.
  2. Leave the path prefix empty (to apply for all files) and set your desired retention policy (I chose hide after 60 days, delete after 90 days):
BackBlaze 90 days backup retention policy

Your Bucket will now automatically delete backups older than 90 days.