From fe0ed83dd4149f7222d2c9501b733d1c7760c60c Mon Sep 17 00:00:00 2001 From: "Kevin Veen-Birkenbach [aka. Frantz]" Date: Mon, 28 Mar 2022 18:14:59 +0200 Subject: [PATCH] solved version bug --- docker-volume-backup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-volume-backup.py b/docker-volume-backup.py index c4b96ac..74896c4 100644 --- a/docker-volume-backup.py +++ b/docker-volume-backup.py @@ -64,8 +64,8 @@ for volume_name in volume_names: pathlib.Path(files_rsync_destination_path).mkdir(parents=True, exist_ok=True) versions = os.listdir(versions_dir_path) versions.sort(reverse=True) - if len(versions) >= 0: - last_version = versions[0] + if len(versions) > 1: + last_version = versions[1] last_version_dir_path = versions_dir_path + last_version + "/" + volume_name if os.path.isdir(last_version_dir_path): link_dest_parameter="--link-dest='" + last_version_dir_path + "' "