From 7702b17a9d05ba7d2bd86cfedfabaaea1052514d Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Mon, 8 Jan 2024 20:43:42 +0100 Subject: [PATCH] Changed from jq to format --- backup-docker-to-local.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backup-docker-to-local.py b/backup-docker-to-local.py index 532e0c0..6385f96 100644 --- a/backup-docker-to-local.py +++ b/backup-docker-to-local.py @@ -142,7 +142,7 @@ def get_last_backup_dir(volume_name, current_backup_dir): return None def getStoragePath(volume_name): - return execute_shell_command(f"docker volume inspect {volume_name} | jq -r '.[0].Mountpoint'") + return execute_shell_command(f"docker volume inspect --format '{{{{ .Mountpoint }}}}' {volume_name}") def backup_volume(volume_name, volume_dir): """Backup files of a volume with incremental backups.""" @@ -159,7 +159,7 @@ def backup_volume(volume_name, volume_dir): print(f"Backup routine for volume: {volume_name} completed.") def get_image_info(container): - return execute_shell_command(f"docker inspect {container} | jq -r '.[].Config.Image'") + return execute_shell_command(f"docker inspect --format '{{{{.Config.Image}}}}' {container}") def has_image(container,image): """Check if the container is using the image"""