feat: add excludes file debug output
This commit is contained in:
parent
b5103b27fc
commit
b6a711a70d
|
@ -103,19 +103,41 @@ def status(config, containers):
|
|||
ping == 0
|
||||
)
|
||||
for mount in container.filter_mounts():
|
||||
source = container.get_volume_backup_destination(mount, '/minecraft')
|
||||
logger.info(
|
||||
' - volume: %s -> %s',
|
||||
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:
|
||||
for mount in container.filter_mounts():
|
||||
source = container.get_volume_backup_destination(mount, '/volumes')
|
||||
logger.info(
|
||||
' - volume: %s -> %s',
|
||||
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:
|
||||
instance = container.instance
|
||||
|
|
|
@ -63,6 +63,16 @@ def remove_containers(containers: List['Container']):
|
|||
except Exception as 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):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue