Backups
Retention and immutability
How long backups are kept, pinning a recovery point, and what Object Lock in Governance or Compliance mode protects against.
On this page
How long backups are kept
By default the backups of the last 30 days are kept, one a day, and never fewer than the last three, whatever else the policy says. In the console you set the number of days on the organisation's Backups page. In brewless.yml you can keep more kinds:
environments:
production:
backup:
retention:
last: 3 # always at least 3
hourly: 24
daily: 30
weekly: 8
monthly: 12
yearly: 0
Each number is how many of that kind to keep: the newest backup of each hour, day, week, month or year, counted back from the newest. Every field you leave out is 0, apart from last, which is never below 3.
Brewless's defaults apply until the organisation's defaults or the environment set something else; the narrowest choice wins.
When a backup is removed
The daily maintenance forgets the backups that fall outside the retention, per destination:
- only for an item whose newest backup on that destination succeeded and passed its check, so a run of failures never eats into the backups you have;
- never in the same run as a backup;
- the space is freed once a week, on Sunday, and not on a destination where forgetting failed.
A secondary destination is kept with the same retention as the primary.
Turning backups off for an environment stops the schedule. What was backed up stays until its retention ends; Brewless deletes no bucket and no backup.
Pinning a recovery point
A pinned recovery point is kept beyond the retention until you unpin it, for example the backup from before a large migration. There is no button for it in the console yet; use the API:
| Endpoint | What it does |
|---|---|
POST /api/environments/{environment}/backups/points/{run}/pin |
Pin the recovery point |
DELETE /api/environments/{environment}/backups/points/{run}/pin |
Unpin it; asks you to confirm that it is you |
Object Lock
The primary destination has Object Lock: Scaleway refuses to delete or overwrite any file of the repository until its lock ends. Every file is locked from the moment it is written, for the daily retention (or the hourly retention in days, whichever is longer) plus 7 days: 37 days with the defaults. What the maintenance removes stays as an older version until that lock ends, and is removed by the bucket's lifecycle rule a day later.
| Mode | Who can delete a locked backup early |
|---|---|
| Governance (the default) | Nobody, except an admin of your Scaleway account who explicitly bypasses the lock |
| Compliance | Nobody, also not the account owner. The lock cannot be shortened |
| None | The bucket keeps versions, but nothing stops a deletion |
Choose the mode per environment in the console, or with backup.lock in brewless.yml. Switching the mode asks you to confirm that it is you, and Deploy on push cannot change it: it needs someone who manages the application.
Warning
With Compliance, a backup you want gone (for example because it holds personal data you were asked to erase) stays until its lock ends, and you keep paying for its storage. Choose it knowingly.
Object Lock protects the files of the repository for the lock period after they were written. A weekly, monthly or yearly backup that you keep longer than that is kept by the retention, not by the lock.
Who may delete, also without a lock
Apart from the lock, only the prune identity may delete in the repository bucket, and its key is mounted only in the maintenance job. The runner that makes the backups may add data but not remove it. See who may delete a backup.
A bunny.net Storage destination has no Object Lock, and the job that writes there can delete; it is never called immutable.
Personal data in backups
A backup is a copy. Data you remove from your application, for example after a request to erase it, stays in the backups made before until they leave the retention, and under Object Lock until the lock ends. Keep the retention as long as you need, and no longer.