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.

BucketDefault CountWhat It Keeps
all1hKeep all snapshots from the last 1 hour
hourly241 snapshot per hour for the last 24 hours
daily71 snapshot per day for the last 7 days
weekly41 snapshot per week for the last 4 weeks
monthly61 snapshot per month for the last 6 months
yearly31 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.

PresetMin Blob AgeTwo-Cycle VerifyTrash Retention
Aggressive5minYes4h
Normal (Default)5minYes24h
Paranoid5minYes72h

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.

💡 GC has a minimum interval of 4 hours by default to avoid running too often. Use force=true to override.

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