Skip to content

Backups: the nightly dump stays on the host it protects; add an optional S3 copy #780

Closed

Description

@arnelirobles

The nightly backup never leaves the machine it exists to protect.

Where

scripts/backup-cron.sh (and its copy quickstart/scripts/backup-cron.sh) dumps to /backups, checks the dump, gzips it, and deletes files older than BACKUP_KEEP_DAYS. /backups is a Docker volume on the same host as Postgres. Losing the host, its disk, or the volume takes the database and every retained backup together.

BaryoDev/BaryoVM#39 is the same gap for stacks deployed by BaryoVM. This issue is the one for the compose files this repository ships.

Proposal

After a dump passes its checks, optionally copy it to S3-compatible storage:

  • Off unless BACKUP_S3_BUCKET is set, so existing deployments behave exactly as today.
  • Same credentials shape as Files.S3 (bucket, region, access key, secret key, optional endpoint for R2 or a self-hosted store), but a separate bucket or prefix, and ideally a separate key with write-only permission (s3:PutObject only), so a compromised app host cannot delete the off-box copies.
  • Retention off-box is left to the bucket's lifecycle rules, not the script, for the same reason.
  • A failed upload fails the run loudly, the same way a bad dump does, without deleting the local copy.

Done when

  • With the variable unset, the script output and behaviour are unchanged (the drift check against the quickstart copy still passes).
  • With it set, a CI job uploads a dump to a test S3 server (SeaweedFS, as the Files.S3 tests use) and restores from the uploaded copy.
  • docs/backup-and-restore.md documents the write-only policy and a lifecycle rule example.

Activity

  1. added
    enhancement
    on Sep 14, 2026
  2. arnelirobles commented on Sep 14, 2026

    @arnelirobles
    ContributorAuthor

    A free target worth testing first: Google Cloud Storage. The Google Cloud Free Tier includes 5 GB-months of regional storage in us-east1, us-west1 or us-central1, 5,000 Class A and 50,000 Class B operations, and 100 GB of outbound transfer from North America per month (https://docs.cloud.google.com/free/docs/free-cloud-features). Nightly compressed dumps of a small site fit well inside that; the dev-playground dump today is about 165 KB.

    GCS speaks the S3 XML API with HMAC keys, so the S3-compatible upload proposed here may work against it unchanged. That is not verified. If this is built, the CI job should run against SeaweedFS as planned, and a one-off manual check against a real GCS bucket with an HMAC key scoped to that bucket should confirm put and a restore from the uploaded copy before the docs name GCS as supported.

  3. modified the milestones: 4.3.0, 4.4.0 on Sep 14, 2026
  4. added
    help wanted
    up-for-grabs
    on Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementhelp wantedup-for-grabs

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions