mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-04-05 20:45:34 -04:00
fix: Added mealie.log rotations to excluded files for backup (#7138)
This commit is contained in:
committed by
GitHub
parent
a89460acdf
commit
5aafebb7a6
@@ -1,5 +1,6 @@
|
||||
import datetime
|
||||
import json
|
||||
import re
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
from zipfile import ZipFile
|
||||
@@ -15,7 +16,8 @@ class BackupSchemaMismatch(Exception): ...
|
||||
|
||||
class BackupV2(BaseService):
|
||||
EXCLUDE_DIRS = {"backups", ".temp"}
|
||||
EXCLUDE_FILES = {"mealie.db", "mealie.log"}
|
||||
EXCLUDE_FILES = {"mealie.db"}
|
||||
EXCLUDE_FILES_REGEX = {re.compile(r"^mealie\.log(?:\.\d+)?$")}
|
||||
EXCLUDE_EXTENTIONS = {".zip"}
|
||||
|
||||
RESTORE_FILES = {".secret"}
|
||||
@@ -54,6 +56,9 @@ class BackupV2(BaseService):
|
||||
if data_file.name in self.EXCLUDE_FILES:
|
||||
continue
|
||||
|
||||
if any(pattern.search(data_file.name) for pattern in self.EXCLUDE_FILES_REGEX):
|
||||
continue
|
||||
|
||||
if data_file.is_file() and data_file.suffix not in self.EXCLUDE_EXTENTIONS:
|
||||
if data_file.parent.name in self.EXCLUDE_DIRS:
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user