Fixed rsync error due to owner/group permissions on external drive file system.

This commit is contained in:
2026-09-20 11:11:14 -05:00
parent 5b7f639821
commit b7d1e243cd
+3 -3
View File
@@ -46,8 +46,8 @@ fi
# Check if the destination directories exist and create them if they don't. # Check if the destination directories exist and create them if they don't.
# This prevents rsync from failing on the first run. # This prevents rsync from failing on the first run.
mkdir -p "$BACKUP_DESTINATION" # mkdir -p "$BACKUP_DESTINATION"
mkdir -p "$PHOTOS_DESTINATION" # mkdir -p "$PHOTOS_DESTINATION"
# ============================================================================== # ==============================================================================
# Home Assistant backup # Home Assistant backup
@@ -68,7 +68,7 @@ else
curl -H "Authorization: Bearer $NTFY_TOKEN" -d "Error: No files found in Home Assistant backup directory." "$NTFY_SERVER/$NTFY_TOPIC" > /dev/null 2>&1 curl -H "Authorization: Bearer $NTFY_TOKEN" -d "Error: No files found in Home Assistant backup directory." "$NTFY_SERVER/$NTFY_TOPIC" > /dev/null 2>&1
else else
FULL_BACKUP_PATH="$HOMEASSISTANT_BACKUP_SOURCE_DIR/$LATEST_BACKUP_FILE" FULL_BACKUP_PATH="$HOMEASSISTANT_BACKUP_SOURCE_DIR/$LATEST_BACKUP_FILE"
rsync -av --progress "$FULL_BACKUP_PATH" "$HOMEASSISTANT_DESTINATION" rsync -av --no-owner --no-group --progress "$FULL_BACKUP_PATH" "$HOMEASSISTANT_DESTINATION"
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
echo "Success: Most recent Home Assistant backup '$LATEST_BACKUP_FILE' copied to '$HOMEASSISTANT_DESTINATION'." echo "Success: Most recent Home Assistant backup '$LATEST_BACKUP_FILE' copied to '$HOMEASSISTANT_DESTINATION'."
curl -H "Authorization: Bearer $NTFY_TOKEN" -d "Success: Home Assistant backup copied to $HOMEASSISTANT_DESTINATION" "$NTFY_SERVER/$NTFY_TOPIC" > /dev/null 2>&1 curl -H "Authorization: Bearer $NTFY_TOKEN" -d "Success: Home Assistant backup copied to $HOMEASSISTANT_DESTINATION" "$NTFY_SERVER/$NTFY_TOPIC" > /dev/null 2>&1