From cb42efa3953c8e8e72be83591312c4081da4127e Mon Sep 17 00:00:00 2001 From: cclohmar Date: Wed, 3 Jun 2026 07:52:23 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20database=20ownership=20preserved=20durin?= =?UTF-8?q?g=20backup=20=E2=80=94=20app=20user=20must=20be=20able=20to=20w?= =?UTF-8?q?rite?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Backup now uses chown --reference to preserve original owner - Found: rsync changed database ownership to root, blocking writes --- install.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install.sh b/install.sh index 1dae949..d4b8679 100755 --- a/install.sh +++ b/install.sh @@ -79,6 +79,8 @@ if [ "${1:-}" = "-update" ]; then sudo_if mkdir -p "$BACKUP_DIR" BACKUP_FILE="$BACKUP_DIR/expenses-$(date +%Y%m%d-%H%M%S).db" sudo_if cp "$INSTALL_DIR/expenses.db" "$BACKUP_FILE" + # Restore ownership so the app user can still write to the database. + sudo_if chown --reference="$INSTALL_DIR/expenses.db" "$BACKUP_FILE" 2>/dev/null || true info "Database backed up to $BACKUP_FILE" fi