From ca4b82507f3624ec0a0af395a58d7b4345f16ec5 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 17 Feb 2022 13:28:50 +0100 Subject: vidhar: ... --- hosts/vidhar/borg/copy.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'hosts/vidhar') diff --git a/hosts/vidhar/borg/copy.py b/hosts/vidhar/borg/copy.py index cd63146d..7a83100a 100755 --- a/hosts/vidhar/borg/copy.py +++ b/hosts/vidhar/borg/copy.py @@ -43,7 +43,7 @@ halo_args = { def read_repo(path): with Halo(text=f'Listing {path}', **halo_args) as sp: res = None - with subprocess.Popen(['borg', 'list', '--info', '--lock-wait', '120', '--json', path], stdout=subprocess.PIPE) as proc: + with subprocess.Popen(['borg', 'list', '--info', '--lock-wait=600', '--json', path], stdout=subprocess.PIPE) as proc: res = json.load(proc.stdout)['archives'] if sp.enabled: sp.succeed(f'{len(res)} archives in {path}') @@ -74,7 +74,7 @@ def copy_archive(src_repo_path, dst_repo_path, entry): match = re.compile('^(.*)-[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.(checkpoint|recreate)(\.[0-9]+)?)?').fullmatch(entry['name']) if match: repo_id = None - with subprocess.Popen(['borg', 'info', '--info', '--lock-wait', '120', '--json', src_repo_path], stdout=subprocess.PIPE) as proc: + with subprocess.Popen(['borg', 'info', '--info', '--lock-wait=600', '--json', src_repo_path], stdout=subprocess.PIPE) as proc: repo_id = json.load(proc.stdout)['repository']['id'] if repo_id: cache_suffix = f'{repo_id}_{match.group(1)}' @@ -111,7 +111,7 @@ def copy_archive(src_repo_path, dst_repo_path, entry): with Halo(text=f'Determine size', **halo_args) as sp: total_size = None total_files = None - with subprocess.Popen(['borg', 'info', '--info', '--json', '--lock-wait', '120', f'{src_repo_path}::{entry["name"]}'], stdout=subprocess.PIPE, text=True) as proc: + with subprocess.Popen(['borg', 'info', '--info', '--json', '--lock-wait=600', f'{src_repo_path}::{entry["name"]}'], stdout=subprocess.PIPE, text=True) as proc: stats = json.load(proc.stdout)['archives'][0]['stats'] total_size = stats['original_size'] total_files = stats['nfiles'] @@ -120,7 +120,7 @@ def copy_archive(src_repo_path, dst_repo_path, entry): else: print(f'{total_files} files, {naturalsize(total_size, binary=True)}', file=stderr) # print(f'Mounting to {dir}', file=stderr) - with subprocess.Popen(['borg', 'mount', '--foreground', '--progress', '--lock-wait', '120', f'{src_repo_path}::{entry["name"]}', dir]) as mount_proc: + with subprocess.Popen(['borg', 'mount', '--foreground', '--progress', '--lock-wait=600', f'{src_repo_path}::{entry["name"]}', dir]) as mount_proc: with Halo(text='Waiting for mount', **halo_args) as sp: wait_start = datetime.now() while True: @@ -141,7 +141,7 @@ def copy_archive(src_repo_path, dst_repo_path, entry): env = os.environ.copy() create_args = ['borg', 'create', - '--lock-wait=120', + '--lock-wait=600', '--one-file-system', '--compression=auto,zstd,10', '--chunker-params=10,23,16,4095', -- cgit v1.2.3