From 96e8727ce0ad878ee590dd942228356c4c12d593 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 8 Feb 2022 20:23:14 +0100 Subject: ymir: ... --- snap.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/snap.py b/snap.py index 80487292..49c1adaa 100755 --- a/snap.py +++ b/snap.py @@ -24,14 +24,14 @@ def waitchildren(): children.remove(waitpid) -def borg_lv(lv, size_percent, target, archive_prefix, dry_run, **args): +def borg_lv(lv, target, archive_prefix, dry_run, **args): vgp = lv.split('/') lvn = vgp[-1] snn = f'{lvn}_snap_{datetime.utcnow().strftime("%Y%m%dT%H%MZ")}' sn = "/".join([*vgp[:-1], snn]) try: - subprocess.run(['lvcreate', f'-l{size_percent}%ORIGIN', '-s', '-n', snn, lv], stdin=subprocess.DEVNULL, check=True) + subprocess.run(['lvcreate', f'-l100%FREE', '-s', '-n', snn, lv], stdin=subprocess.DEVNULL, check=True) creation_time = None with subprocess.Popen(['lvs', '--reportformat=json', '-olv_time', sn], stdout=subprocess.PIPE) as proc: @@ -105,7 +105,6 @@ def main(): parser = argparse.ArgumentParser() parser.add_argument('lv', metavar='LV') - parser.add_argument('--size-percent', metavar='PERCENT', type = float, default=10) parser.add_argument('--target', metavar='REPO', default='borg.vidhar:.') parser.add_argument('--archive-prefix', metavar='REPO', default='yggdrasil.niflheim.ymir.') parser.add_argument('--dry-run', action='store_true') -- cgit v1.2.3