feat: add excludes file debug output
This commit is contained in:
parent
b5103b27fc
commit
b6a711a70d
2 changed files with 34 additions and 2 deletions
|
@ -103,18 +103,40 @@ def status(config, containers):
|
||||||
ping == 0
|
ping == 0
|
||||||
)
|
)
|
||||||
for mount in container.filter_mounts():
|
for mount in container.filter_mounts():
|
||||||
|
source = container.get_volume_backup_destination(mount, '/minecraft')
|
||||||
logger.info(
|
logger.info(
|
||||||
' - volume: %s -> %s',
|
' - volume: %s -> %s',
|
||||||
mount.source,
|
mount.source,
|
||||||
container.get_volume_backup_destination(mount, '/minecraft'),
|
source,
|
||||||
|
)
|
||||||
|
excludes_file = os.path.join(source, "excludes.txt")
|
||||||
|
logger.debug(
|
||||||
|
'excludes_file location: %s',
|
||||||
|
excludes_file
|
||||||
|
)
|
||||||
|
if os.path.isfile(excludes_file):
|
||||||
|
logger.info(
|
||||||
|
' excluding: %s',
|
||||||
|
utils.join_file_content(excludes_file)
|
||||||
)
|
)
|
||||||
|
|
||||||
if container.volume_backup_enabled:
|
if container.volume_backup_enabled:
|
||||||
for mount in container.filter_mounts():
|
for mount in container.filter_mounts():
|
||||||
|
source = container.get_volume_backup_destination(mount, '/volumes')
|
||||||
logger.info(
|
logger.info(
|
||||||
' - volume: %s -> %s',
|
' - volume: %s -> %s',
|
||||||
mount.source,
|
mount.source,
|
||||||
container.get_volume_backup_destination(mount, '/volumes'),
|
source,
|
||||||
|
)
|
||||||
|
excludes_file = os.path.join(source, "excludes.txt")
|
||||||
|
logger.debug(
|
||||||
|
'excludes_file location: %s',
|
||||||
|
excludes_file
|
||||||
|
)
|
||||||
|
if os.path.isfile(excludes_file):
|
||||||
|
logger.info(
|
||||||
|
' excluding: %s',
|
||||||
|
utils.join_file_content(excludes_file)
|
||||||
)
|
)
|
||||||
|
|
||||||
if container.database_backup_enabled:
|
if container.database_backup_enabled:
|
||||||
|
|
|
@ -63,6 +63,16 @@ def remove_containers(containers: List['Container']):
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
logger.exception(ex)
|
logger.exception(ex)
|
||||||
|
|
||||||
|
def join_file_content(file):
|
||||||
|
if not os.path.isfile(file):
|
||||||
|
return ""
|
||||||
|
with open(file) as c:
|
||||||
|
output = ""
|
||||||
|
lines = c.readlines()
|
||||||
|
for i in range(len(lines)):
|
||||||
|
output += lines[i] + ","
|
||||||
|
return output
|
||||||
|
|
||||||
|
|
||||||
def is_true(value):
|
def is_true(value):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Add table
Reference in a new issue