# Backup Retention Policy

Cloudback allows you to set up a backup retention policy for your repositories. The retention policy defines how long the backups should be kept before they are automatically deleted. Retention policies apply to all supported platforms.

## How Retention Works

A retention policy has two enforcement dimensions that both apply to every backup definition:

* **Age limit**: backups older than the configured number of days are deleted.
* **Count limit**: when the number of successful backups exceeds the configured maximum, the oldest backups are removed first.

Both limits are checked independently. A backup is removed if it violates either limit.

### Deduplication protection

Backups that serve as a deduplication parent (referenced by one or more newer backups) are **never deleted**, even if they exceed the configured limits. This ensures that backups referencing a parent archive always remain valid.

### Enforcement timing

Retention is enforced **hourly** by a background maintenance job. Changing a retention policy does not delete backups immediately - the change takes effect at the next hourly enforcement pass.

## Available Retention Presets

Cloudback includes the following built-in retention policies, available to all accounts:

| Policy        | Age Limit | Count Limit  |
| ------------- | --------- | ------------ |
| Last 30 days  | 30 days   | 200 backups  |
| Last 90 days  | 90 days   | 270 backups  |
| Last 180 days | 180 days  | 540 backups  |
| Last 360 days | 360 days  | 1080 backups |

The default policy for new accounts and new repositories is **Last 30 days**.

## Setting Up a Backup Retention Policy

Follow these steps to set a retention policy for a repository:

1. Go to the [Cloudback Dashboard](https://app.cloudback.it/).
2. Open the repository details page for the repository you want to configure.
3. In the **Settings** section, locate the `Retention` combo box and choose the retention policy you want to apply to the repository:

![Backup retention policy](/files/duZOYJy3Vc18Cjh8bvWY)

4. Click the **Save** button to save the changes.

You can update the retention policy for multiple repositories at once using [Bulk Operations](/managing-backups/bulk-operations.md).

## Custom Retention Policies

If the built-in presets don't cover your use case, you can request a **custom retention policy** with specific age and count limits.

Custom retention policies can't be created from the UI. To request one, [contact the Cloudback support team](/troubleshooting-and-support/contact-us.md) at <support@cloudback.it> with your desired age limit (in days) and count limit. Custom policies are usually set up within one business day.

Once created, your custom retention policy will appear in the **Retention** dropdown alongside the built-in presets - both in the repository settings and in [Account Settings](/managing-backups/account-settings.md). The support team can also restrict a custom policy to specific platform accounts.

## Account-Level Default Retention

The **Account Settings** page lets you configure a default retention policy that is applied automatically to all new repositories added to your account. Changing the account-level default does not affect repositories that already have a retention policy assigned - use [Bulk Operations](/managing-backups/bulk-operations.md) to update existing repositories.

## Learn More

* [Account Settings](/managing-backups/account-settings.md)
* [Bulk Operations](/managing-backups/bulk-operations.md)
* [Contact Us](/troubleshooting-and-support/contact-us.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cloudback.it/managing-backups/backup-retention-policy.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
