From 7594f5047dc5bc95906997feaca297a61f3e9ead Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Thu, 24 Dec 2020 18:11:59 +0100 Subject: [PATCH] Solved bug --- docker-volume-backup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-volume-backup.sh b/docker-volume-backup.sh index 5b34f32..f0650a7 100644 --- a/docker-volume-backup.sh +++ b/docker-volume-backup.sh @@ -12,7 +12,7 @@ do echo "stop container: $docker_container_name" && docker stop "$docker_container_name" for source_path in $(docker inspect --format '{{ range .Mounts }}{{ if eq .Type "volume" }}{{ println .Destination }}{{ end }}{{ end }}' "$docker_container_name"); do - repository_name="$(basename -s .git `git config --get remote.origin.url`)"; + repository_name="$(cd $(dirname "$(readlink -f "${0}")") && basename `git rev-parse --show-toplevel`)"; machine_id="$(sha256sum /etc/machine-id | head -c 64)"; backup_repository_folder="$docker_backups_mount$machine_id/$repository_name/"; destination_path="$backup_repository_folder""latest/$docker_container_name$source_path";