Retention Policies
Automatically manage backup storage by defining how long to keep backups.
Overview
Retention policies prevent unlimited storage growth by automatically deleting old backups. DBackup supports two retention modes:
| Mode | Description | Best For |
|---|---|---|
| None | Keep all backups | Manual management |
| Simple | Keep last N backups | Fixed rotation |
| Smart (GVS) | Grandfather-Father-Son | Long-term archival |
Per-Destination Retention
Retention is configured individually for each destination within a job. This means a single job can have different retention strategies per storage location.
Example
| Destination | Mode | Configuration |
|---|---|---|
| Local NAS | Simple | Keep last 30 |
| AWS S3 | Smart (GFS) | Daily: 7, Weekly: 4, Monthly: 12 |
| Dropbox | None | Keep all |
Configuration
In the job form, expand each destination row to configure its retention:
- Click the expand arrow on a destination
- Select the retention mode (None / Simple / Smart)
- Configure mode-specific settings
- Each destination saves its retention independently
Simple Retention
Keep a fixed number of recent backups.
Configuration
| Setting | Description |
|---|---|
| Keep Count | Number of backups to retain |
Example
With Keep Count: 5:
- After 6th backup: 1st is deleted
- After 7th backup: 2nd is deleted
- Always maintains exactly 5 backups
Use Cases
- Development environments
- Frequent backups with short retention
- Simple rotation needs
Smart Retention (GVS)
Grandfather-Father-Son is an intelligent retention strategy that keeps:
- Recent backups (daily)
- Some older backups (weekly)
- Fewer old backups (monthly)
- Minimal very old backups (yearly)
Configuration
| Setting | Description | Example |
|---|---|---|
| Daily | Days to keep daily backups | 7 |
| Weekly | Weeks to keep weekly backups | 4 |
| Monthly | Months to keep monthly backups | 12 |
| Yearly | Years to keep yearly backups | 3 |
How It Works
The algorithm evaluates each backup:
- Daily bucket: Is this one of the last N days' backups?
- Weekly bucket: Is this the most recent backup from the last N weeks?
- Monthly bucket: Is this the most recent backup from the last N months?
- Yearly bucket: Is this the most recent backup from the last N years?
A backup is kept if it qualifies for any bucket.
Example Timeline
Configuration: Daily=7, Weekly=4, Monthly=12, Yearly=2
After 1 year of daily backups:
- Days 1-7: All 7 daily backups kept
- Weeks 2-4: 1 backup per week (3 more)
- Months 2-12: 1 backup per month (11 more)
- Previous year: 1 backup kept
Total: ~22 backups instead of 365!
Visual Example
Today 7 days ago 1 month ago 1 year ago
| | | |
▼ ▼ ▼ ▼
[■][■][■][■][■][■][■] [■] [■] [■]... [■]
└── Daily ──┘ └ Weekly ┘ └── Monthly ──┘Locked Backups
Prevent specific backups from being deleted:
- Go to Storage Explorer
- Find the backup
- Click Lock icon
Locked backups:
- ✅ Never deleted by retention
- ✅ Don't count against limits
- ✅ Persist indefinitely
Use Cases for Locking
- Pre-migration snapshots
- Known-good backups
- Compliance requirements
- Before major changes
Configuration Guide
Conservative (Long Retention)
Daily: 14
Weekly: 8
Monthly: 24
Yearly: 5Keeps ~50 backups over 5 years.
Moderate (Balanced)
Daily: 7
Weekly: 4
Monthly: 12
Yearly: 2Keeps ~25 backups over 2 years.
Aggressive (Minimal)
Daily: 3
Weekly: 2
Monthly: 6
Yearly: 1Keeps ~12 backups over 1 year.
Retention Execution
Retention runs as the final step of each backup job, applied per destination:
- Backup upload completes for a destination
- List all backups for this job in that specific destination
- Read metadata (check lock status)
- Apply that destination's retention policy
- Delete expired backups
- Repeat for each remaining destination
Skipped on Failure
Retention is skipped for any destination where the upload failed. This prevents deleting old backups when the new backup didn't arrive.
Compliance Considerations
GDPR
- Consider data minimization principles
- Balance retention vs. "right to erasure"
- Document retention policy
SOX/Financial
- May require 7+ years retention
- Use yearly retention setting
- Lock compliance-critical backups
HIPAA
- Minimum 6 years retention
- Consider encryption for all backups
- Document access to backups
Best Practices
Match Schedule to Retention
| Schedule | Recommended Retention |
|---|---|
| Hourly | Daily: 24-48 |
| Daily | Daily: 7-14 |
| Weekly | Weekly: 4-8 |
| Monthly | Monthly: 12-24 |
Start Conservative
Begin with longer retention, then reduce:
- Storage is cheap
- You can't recover deleted backups
- Analyze needs before reducing
Test Before Production
- Create test job with short retention
- Verify deletion works correctly
- Then apply to production
Monitor Storage
- Watch storage growth
- Adjust retention if growing too fast
- Use compression to reduce size
Storage Calculation
Estimate storage needs:
Storage = (Backup Size) × (Retained Backups)Example with Smart Retention (Daily=7, Weekly=4, Monthly=12, Yearly=2):
- 100MB daily backup
- ~25 backups retained
- Storage: ~2.5GB
With compression (70% reduction):
- Storage: ~750MB
Troubleshooting
Backups Not Being Deleted
- Verify retention is enabled on job
- Check if backups are locked
- View job logs for retention step
- Ensure backup ran successfully
Too Many Backups Deleted
- Check retention settings
- Verify date/time on backups
- Lock important backups
- Increase retention values
Wrong Backups Deleted
The GVS algorithm keeps the oldest backup in each time bucket. This is intentional:
- Weekly: Keeps backup from start of week
- Monthly: Keeps backup from start of month
API Reference
Retention configuration in job:
{
"retention": {
"mode": "SMART",
"simple": {
"keepCount": 5
},
"smart": {
"daily": 7,
"weekly": 4,
"monthly": 12,
"yearly": 2
}
}
}Next Steps
- Creating Jobs - Configure backup jobs
- Storage Explorer - Browse and lock backups
- Encryption - Secure your backups