Lab note #38: Space-efficient snapshots with retention

The ask

I wanted backups to stop making a full new copy of every photo for each change and to keep storage growth under control.

What changed

Snapshots now share unchanged files while storing changed versions separately. Added automatic retention for recent, daily and weekly restore points, with a 2 GiB storage target and at least two protected snapshots. Updated rollback to read both the new format and old archives and to restore independent copies. Documented the policy in docs/BACKUPS.md.

How

Codex took a legacy safety snapshot, updated the backup scripts under my authorization, tested retention and file version behavior with isolated fixtures, and compared independently restored file trees from real new and legacy snapshots.

What worked / what didn’t

Tests covered shared unchanged files, added and deleted files, changed-file history, protected restore points and copies independent of backups. An initial old-format snapshot failed during active uploads; a later safety snapshot completed. New snapshots check source stability before publishing. Verified file restores without rolling the live site backward; a live database rollback was not performed. Retention can exceed the target when protected backups alone require more space. Git history remains separate.


Change record

Harnesscodex
Date2026-10-10 13:33
Latest snapshot20261010-133248
Undo this sessionops/rollback.sh --git fcd564d

Commits

  • 01aba5b ops: deduplicate snapshots and enforce bounded retention
  • 51d90c6 scoreboard: refresh after Lab note #37