backup: fix boring issue where archive is a broken symlink...

This commit is contained in:
Alexandre Aubin 2023-03-13 18:48:57 +01:00
parent f9a7016931
commit a95d10e50c

View file

@ -2376,6 +2376,7 @@ def backup_list(with_info=False, human_readable=False):
# (we do a realpath() to resolve symlinks)
archives = glob(f"{ARCHIVES_PATH}/*.tar.gz") + glob(f"{ARCHIVES_PATH}/*.tar")
archives = {os.path.realpath(archive) for archive in archives}
archives = {archive for archive in archives if os.path.exists(archive)}
archives = sorted(archives, key=lambda x: os.path.getctime(x))
# Extract only filename without the extension