From 24320f012ab36285f1ee3c3029833ccc157747c9 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 13 Mar 2022 19:55:10 +0100 Subject: ... --- hosts/vidhar/borg/copy.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'hosts') diff --git a/hosts/vidhar/borg/copy.py b/hosts/vidhar/borg/copy.py index 2ee4761d..324fea0b 100755 --- a/hosts/vidhar/borg/copy.py +++ b/hosts/vidhar/borg/copy.py @@ -245,6 +245,17 @@ def copy_archive(src_repo_path, dst_repo_path, entry): continue except subprocess.CalledProcessError as err: print(err, file=stderr) + + dst = None + try: + dst = read_repo(args.target) + except (subprocess.CalledProcessError, json.decoder.JSONDecodeError) as err: + print(err, file=stderr) + continue + else: + if any(map(lambda other: entry['name'] == other['name'], dst)): + break + continue else: break -- cgit v1.2.3