1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Improve backup exclude filters (#141311)

* Improve backup exclude filters

* Add comment
This commit is contained in:
Erik Montnemery
2025-03-25 09:52:45 +01:00
committed by GitHub
parent 4f6daa227a
commit 36d32eaabc
4 changed files with 8 additions and 3 deletions

View File

@@ -1726,7 +1726,9 @@ class CoreBackupReaderWriter(BackupReaderWriter):
"""Filter to filter excludes."""
for exclude in excludes:
if not path.match(exclude):
# The home assistant core configuration directory is added as "data"
# in the tar file, so we need to prefix that path to the filters.
if not path.full_match(f"data/{exclude}"):
continue
LOGGER.debug("Ignoring %s because of %s", path, exclude)
return True