mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2025-01-31 12:56:11 +01:00
Merge branch 'bug/backup-exclusions' into 'dev'
Fix backup error if excluded dir doesn't exists. See merge request crafty-controller/crafty-4!301
This commit is contained in:
commit
2696c8eb65
@ -858,10 +858,20 @@ class ServerInstance:
|
|||||||
if os.path.isdir(excluded_dir):
|
if os.path.isdir(excluded_dir):
|
||||||
# If it is a directory,
|
# If it is a directory,
|
||||||
# recursively delete the entire directory from the backup
|
# recursively delete the entire directory from the backup
|
||||||
FileHelpers.del_dirs(excluded_dir)
|
try:
|
||||||
|
FileHelpers.del_dirs(excluded_dir)
|
||||||
|
except FileNotFoundError:
|
||||||
|
Console.error(
|
||||||
|
f"Excluded dir {excluded_dir} not found. Moving on..."
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
# If not, just remove the file
|
# If not, just remove the file
|
||||||
os.remove(excluded_dir)
|
try:
|
||||||
|
os.remove(excluded_dir)
|
||||||
|
except:
|
||||||
|
Console.error(
|
||||||
|
f"Excluded dir {excluded_dir} not found. Moving on..."
|
||||||
|
)
|
||||||
if conf["compress"]:
|
if conf["compress"]:
|
||||||
logger.debug(
|
logger.debug(
|
||||||
"Found compress backup to be true. Calling compressed archive"
|
"Found compress backup to be true. Calling compressed archive"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user