Skip to content

feat(backup): nightly off-site copy to Cloudflare R2; keep 2 local copies - #696

Merged
mrviduus merged 3 commits into
mainfrom
feat/offsite-backup-r2
Oct 4, 2026
Merged

mrviduus merged 3 commits into
mainfrom
feat/offsite-backup-r2

Conversation

@mrviduus

@mrviduus mrviduus commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Why

Architecture review 2026-10, P0 #4: every backup lived on the same box as the data.

What

  • New step: restic (Docker image restic/restic:0.17.3, nothing installed on the host) → Cloudflare R2 bucket textstack-backups. Backs up the nightly DB dump, data/storage (directly — deduplicated) and .env. Encrypted client-side (RESTIC_PASSWORD, also in the owner's password manager).
  • Retention: 7 nightly + 3 monthly. Guard: fails above 9 GB (before and after the snapshot) to stay inside R2's free 10 GB. Skips with a warning if secrets are missing.
  • Local copies 5 → 2 (nightly db + storage, pre-deploy dumps) — frees ~8 GB on /; history now lives in R2.
  • tar exit 1 ("file changed as we read it") is a warning, not a failure — it broke the first test run.

Verified

  • restic commands dry-run locally against a local repo (init/backup/forget/check/stats parse).
  • Branch test run on the server: see the run linked in the comment below.

Rollback

Revert. The R2 bucket/secrets can stay.

🤖 Generated with Claude Code

@mrviduus
mrviduus force-pushed the feat/offsite-backup-r2 branch 2 times, most recently from 1d923c9 to dcc9d66 Compare October 4, 2026 23:09
mrviduus and others added 3 commits October 4, 2026 19:29
DB dump + storage + .env, encrypted + deduplicated; keep 7 nightly + 3 monthly;
fails above 9 GB to stay inside R2's free 10 GB. Skipped until secrets exist.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@mrviduus
mrviduus force-pushed the feat/offsite-backup-r2 branch from dcc9d66 to 095c806 Compare October 4, 2026 23:29
@mrviduus
mrviduus merged commit 6f33c32 into main Oct 4, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant