Skip to content

Off-machine backup: mirror DB backups to online storage (Twake Drive) #324

Description

@corentin-core

Context

Database backups are written to ~/.local/share/budget-forecaster/backups/ on the deployment host, rotated to the last 5 (max_backups), created ~daily (each sync opens the repo) plus on each web-service restart. They live on the same disk as the live DB, so they protect against DB corruption / a bad migration but not against disk failure or loss of the machine. Since the Enable Banking consent was revoked, the transaction history cannot be re-synced from scratch — an off-machine copy is the only real safety net.

The user uses Twake Workplace (Twake Drive, Nextcloud-based) as online storage.

Proposed solution

Mirror each backup to online storage. Options (pick one):

  1. In-app mirror — add an optional mirror_directory to BackupConfig; after a successful backup, also copy the file there (with its own retention, independent of the local rolling-5). The mirror path points at a folder the Twake desktop app syncs, or a mounted remote. Testable, works for TUI/CLI/web paths.
  2. Ops: sync to a Twake-synced folder — a systemd --user timer on the host copies new backups to a Windows folder synced by the Twake desktop app (/mnt/c/Users/<user>/<TwakeFolder>/... from WSL). Depends on the Windows app running/logged in.
  3. Ops: push via WebDAV (rclone) — a systemd --user timer runs rclone copy backups/ twake:budget-backups/ against Twake Drive's WebDAV endpoint (Nextcloud-based → WebDAV, to confirm). Headless, does not depend on the Windows desktop app.

Acceptance criteria

  • A backup taken on the host appears in the online Twake Drive within a day.
  • Works while the host is the only running machine (no dependency on another PC being on) — or the dependency is documented.
  • Retention on the remote is defined (keep more history than the local 5, or match it).
  • Setup documented in docs/user/deployment.md.

Related issues

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions