borgmatic: stage SQLite dump beside source DB (minimal images lack /tmp)

The helper wrote its staging copy to /tmp, but minimal nix images (mealie)
have no /tmp, so the dump failed 'unable to open database file'. Write it
next to the source DB instead (always on a writable volume); works for any
image, shower included.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erich Blume 2026-06-03 11:32:17 -07:00
commit 71d5759eb5

View file

@ -28,7 +28,9 @@ db_path=${4:?missing db path}
name=${5:?missing name}
dump_target=${6:?missing dump target}
pod_tmp="/tmp/${name}-backup.db"
# Stage the backup next to the source DB (a guaranteed-writable volume);
# minimal nix images (e.g. mealie) have no /tmp.
pod_tmp="$(dirname "$db_path")/.borgmatic-backup-${name}.db"
python_backup='import sqlite3; sqlite3.connect("'"$db_path"'").backup(sqlite3.connect("'"$pod_tmp"'"))'