Skip to content

Fix backup and restore reliability bugs - #31

Draft
itbm wants to merge 1 commit into
masterfrom
cursor/fix-backup-bugs-d119
Draft

Fix backup and restore reliability bugs#31
itbm wants to merge 1 commit into
masterfrom
cursor/fix-backup-bugs-d119

Conversation

@itbm

@itbm itbm commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes the reliability bugs identified in review (except the intentional dual image names).

Changes

  1. S3 checksum failures — default AWS_REQUEST_CHECKSUM_CALCULATION / AWS_RESPONSE_CHECKSUM_VALIDATION to when_required to avoid XAmzContentSHA256Mismatch with AWS CLI v2 / S3-compatible stores
  2. Dump cleanup — write dumps under /tmp and remove them after upload (and on failure via trap)
  3. Ash compatibility — replace [[ … ]] / == with POSIX case / = so scripts work under Alpine BusyBox ash
  4. UTC timestamps — use date -u so the Z suffix is accurate
  5. Encryption — encrypt with PBKDF2 (100k iterations); restore tries PBKDF2 then falls back to legacy OpenSSL KDF
  6. POSTGRES_EXTRA_DUMP_OPTS — dump-only flags for pg_dump / pg_dumpall without affecting restore clients
  7. Cron timeout — remove the hard-coded 1h limit; optional COMMAND_TIMEOUT (go duration, e.g. 2h)
  8. Overlapping schedules — skip a run if the previous command is still running
  9. SQL identifier safety — quote database names for DROP / CREATE DATABASE

Docs

  • README updates for the new env vars and PBKDF2 decrypt command

Test plan

  • dash -n on backup.sh, restore.sh, run.sh
  • go build for go-cron
  • OpenSSL PBKDF2 encrypt/decrypt round-trip
  • Legacy OpenSSL decrypt fallback
  • Overlap skip smoke test with @every 1s
Open in Web Open in Cursor 

Address S3 checksum failures, leftover dump files, ash-incompatible
tests, UTC timestamps, PBKDF2 encryption with legacy decrypt fallback,
dump-only pg options, configurable cron timeout, overlapping schedule
skips, and safer SQL identifier quoting.

Co-authored-by: itbm <itbm@users.noreply.github.com>
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.

2 participants