From a27bdcbacdf206945545ee12251fbfab838183b3 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 17 Feb 2022 12:38:54 +0100 Subject: vidhar: ... --- hosts/vidhar/borg/copy.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'hosts/vidhar/borg') diff --git a/hosts/vidhar/borg/copy.py b/hosts/vidhar/borg/copy.py index 04bb61f8..d8d64dca 100755 --- a/hosts/vidhar/borg/copy.py +++ b/hosts/vidhar/borg/copy.py @@ -21,6 +21,7 @@ from xdg import xdg_runtime_dir import pathlib import unshare +import signal from time import sleep from halo import Halo @@ -199,7 +200,12 @@ def copy_archive(src_repo_path, dst_repo_path, entry): if waitpid == child: break +def sigterm(signum, frame): + raise SystemExit(128 + signum) + def main(): + signal.signal(signal.SIGTERM, sigterm) + if "::" in args.source: (src_repo_path, _, src_archive) = args.source.partition("::") entry = None -- cgit v1.2.3