Clean up backup server method for readability

This commit is contained in:
xithical 2022-02-27 13:17:14 -06:00
parent 7c5bb0984c
commit eaca8acf72

View File

@ -570,11 +570,11 @@ class Server:
logger.info(f"Creating backup of server '{self.settings['server_name']}'" +
f" (ID#{self.server_id}, path={self.server_path}) at '{backup_filename}'")
# shutil.make_archive(helper.get_os_understandable_path(backup_filename), 'zip', self.server_path)
tempDir = tempfile.mkdtemp()
shutil.copytree(self.server_path, tempDir)
excluded_dirs = management_helper.get_excluded_backup_dirs(self.server_id)
server_dir = helper.get_os_understandable_path(self.settings['path'])
for dir in excluded_dirs:
temp_dir = helper.get_os_understandable_path(dir).replace(server_dir, helper.get_os_understandable_path(tempDir))
if os.path.isdir(temp_dir):