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