Retention & GC
Smart retention keeps useful snapshots. Automatic cleanup frees wasted space.
GFS Retention (Grandfather-Father-Son)
Ginkgo uses GFS rotation to bucket snapshots by time — from hours to years. Recent snapshots are dense, older ones sparse. You keep history without wasting space.
| Bucket | Default Count | What It Keeps |
|---|---|---|
all | 1h | Keep all snapshots from the last 1 hour |
hourly | 24 | 1 snapshot per hour for the last 24 hours |
daily | 7 | 1 snapshot per day for the last 7 days |
weekly | 4 | 1 snapshot per week for the last 4 weeks |
monthly | 6 | 1 snapshot per month for the last 6 months |
yearly | 3 | 1 snapshot per year for the last 3 years |
Snapshot Pinning
Pin important snapshots to protect them from retention and GC — e.g. before a release, or a major milestone.
GC Safety Presets
Three presets control how conservative GC is. For production, use Normal or Paranoid.
| Preset | Min Blob Age | Two-Cycle Verify | Trash Retention |
|---|---|---|---|
| Aggressive | 5min | Yes | 4h |
| Normal (Default) | 5min | Yes | 24h |
| Paranoid | 5min | Yes | 72h |
Garbage Collection (GC)
GC removes data blocks no longer referenced by any snapshot, freeing space. Ginkgo's GC only deletes — never rewrites. Deletion is idempotent: if something goes wrong, just rerun. Always preview with --dry-run first.
Backup Verification
Verify backup integrity to ensure you can recover when it matters:
Quick Verify
Checks blob existence (index level)
Deep Verify
Reads and hashes all data blocks
Auto Repair
On corruption, attempts to recover from cloud storage
GBF Storage Format
Backup data is stored in GBF (Ginkgo Backup Format), content-addressed:
- Data blocks: gb/{hash[:2]}/{hash}.gb — each block stored independently, no aggregation
- Manifests: .ginkgo-backup/manifests/{sourceID}/ — zstd-compressed JSON, one complete independent manifest per backup
- Encrypted blocks are prefixed with the GB1\x00 magic bytes; encrypted manifests with GKM1