Solved trailing spaces bug

This commit is contained in:
Kevin Veen-Birkenbach 2024-01-11 12:20:38 +01:00
parent 35e28f31d2
commit 7fe1886ff9
1 changed files with 7 additions and 2 deletions

View File

@ -142,12 +142,17 @@ def get_last_backup_dir(volume_name, current_backup_dir):
return None
def getStoragePath(volume_name):
return execute_shell_command(f"docker volume inspect --format '{{{{ .Mountpoint }}}}' {volume_name}")[0]
path = execute_shell_command(f"docker volume inspect --format '{{{{ .Mountpoint }}}}' {volume_name}")[0]
return f"{path}/"
def getFileRsyncDestinationPath(volume_dir):
path = os.path.join(volume_dir, "files")
return f"{path}/"
def backup_volume(volume_name, volume_dir):
"""Backup files of a volume with incremental backups."""
print(f"Starting backup routine for volume: {volume_name}")
files_rsync_destination_path = os.path.join(volume_dir, "files")
files_rsync_destination_path = getFileRsyncDestinationPath(volume_dir)
pathlib.Path(files_rsync_destination_path).mkdir(parents=True, exist_ok=True)
last_backup_dir = get_last_backup_dir(volume_name, files_rsync_destination_path)