From 71d5759eb5bd61dc4f030fe01532c835b3bf5d69 Mon Sep 17 00:00:00 2001 From: Erich Blume Date: Wed, 3 Jun 2026 11:32:17 -0700 Subject: [PATCH] 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) --- ansible/roles/borgmatic/templates/k8s-sqlite-dump.sh.j2 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ansible/roles/borgmatic/templates/k8s-sqlite-dump.sh.j2 b/ansible/roles/borgmatic/templates/k8s-sqlite-dump.sh.j2 index 323e717..9cc24da 100644 --- a/ansible/roles/borgmatic/templates/k8s-sqlite-dump.sh.j2 +++ b/ansible/roles/borgmatic/templates/k8s-sqlite-dump.sh.j2 @@ -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"'"))'