fix: database ownership preserved during backup — app user must be able to write
- Backup now uses chown --reference to preserve original owner - Found: rsync changed database ownership to root, blocking writes
This commit is contained in:
parent
bb34528bf5
commit
cb42efa395
1 changed files with 2 additions and 0 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue