From b2e9c4a40bb11bfb7e5eceb7cb3aa387c2d57a59 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 8 Feb 2022 16:37:26 +0100 Subject: ymir: ... --- snap.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/snap.py b/snap.py index 68a62c7c..3d9c315a 100755 --- a/snap.py +++ b/snap.py @@ -13,6 +13,7 @@ from tempfile import TemporaryDirectory import pathlib import unshare +import signal def borg_lv(lv, size_percent, target, archive_prefix, dry_run, **args): @@ -66,7 +67,7 @@ def borg_lv(lv, size_percent, target, archive_prefix, dry_run, **args): '--chunker-params=10,23,16,4095', f'--timestamp={creation_time.strftime("%Y-%m-%dT%H:%M:%S")}', '--show-rc', - '--progress', + # '--progress', '--list', '--filter=AMEi-x?', '--stats', @@ -91,7 +92,12 @@ def borg_lv(lv, size_percent, target, archive_prefix, dry_run, **args): finally: subprocess.run(['lvremove', '--force', sn], stdin=subprocess.DEVNULL, check=True) +def sigterm(signum, frame): + raise SystemExit(128 + signum) + def main(): + signal.signal(signal.SIGTERM, sigterm) + parser = argparse.ArgumentParser() parser.add_argument('lv', metavar='LV') parser.add_argument('--size-percent', metavar='PERCENT', type = float, default=10) -- cgit v1.2.3