Backup Retention Policy Setup
Who this is for
Users who want to control how long their backups are kept and reduce unnecessary disk usage on their servers.
How Retention Works
When a backup is created, CloudAIPilot sets an expiry date based on the retention period you configured:
expiresAt = createdAt + retentionDays
When the expiry date passes, CloudAIPilot automatically deletes the backup and its files from the server.
Retention period range: 1 to 365 days (default: 30 days).
Setting Retention for On-Demand Backups
When creating a one-time backup (see KB-05-02: Create an On-Demand Backup):
- Set Retention to the number of days you want the backup kept.
- Leave blank to use the default (30 days).
Setting Retention for Backup Schedules
When creating or editing a backup schedule (see KB-05-03: Configure Backup Schedules):
- The Retention days field controls how long each backup created by this schedule will be kept.
- Example: a daily backup schedule with 30-day retention keeps up to 30 backups at any time.
Recommended Retention Periods
| Backup type | Recommended retention |
|---|---|
| Daily database backup | 30 days |
| Weekly full backup | 90 days |
| Monthly snapshot | 365 days |
| Pre-deployment backup | 14 days |
Manually Deleting a Backup
If you want to remove a backup before its expiry date:
- Open the server detail → Backups tab.
- Find the backup.
- Click Delete (trash icon).
Note: You cannot delete a backup while it is running. Wait for the backup to complete first.
CloudAIPilot performs a best-effort SSH cleanup of the backup files on the server (/tmp/cloudpilot-backups/). If the server is offline, the cleanup is skipped — the record is deleted from CloudAIPilot but the files may remain on the server.
Disk Space Planning
Each backup consumes disk space on your server at /tmp/cloudpilot-backups/. Plan your retention accordingly:
| Setup example | Disk usage |
|---|---|
| Daily database backup (100 MB each), 30-day retention | ~3 GB |
| Weekly full backup (1 GB each), 12-week retention | ~12 GB |
| Daily full backup (1 GB each), 30-day retention | ~30 GB |
Tip: Keep your most important, long-term backups in cloud storage (offsite) rather than relying on local server disk retention.
What Success Looks Like
Backups older than the retention period disappear automatically from the Backups list. Disk usage on the server does not grow unboundedly.
Related Articles
- KB-05-02: Create an On-Demand Backup
- KB-05-03: Configure Backup Schedules
- KB-05-07: Cloud Storage Vault for Offsite Backup