From 234eab10a84e7ffb8bbc32f5e2f94495d3c9aedd Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 1 Nov 2022 21:33:59 +0100 Subject: ... --- hosts/vidhar/borg/borgsnap/borgsnap/__main__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'hosts/vidhar/borg/borgsnap') diff --git a/hosts/vidhar/borg/borgsnap/borgsnap/__main__.py b/hosts/vidhar/borg/borgsnap/borgsnap/__main__.py index fb206e33..15bf50c8 100644 --- a/hosts/vidhar/borg/borgsnap/borgsnap/__main__.py +++ b/hosts/vidhar/borg/borgsnap/borgsnap/__main__.py @@ -262,6 +262,8 @@ def create(*, snapshot, target, archive_prefix, dry_run): with subprocess.Popen(create_args, stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env, preexec_fn=lambda: as_borg(caps={Cap.DAC_READ_SEARCH}), cwd=dir, text=True) as proc: proc_logger = logger.getChild('borg') + stdout_logger = proc_logger.getChild('stdout') + stderr_logger = proc_logger.getChild('stderr') poll = select.poll() poll.register(proc.stdout, select.POLLIN | select.POLLHUP) @@ -274,11 +276,11 @@ def create(*, snapshot, target, archive_prefix, dry_run): if rfd == proc.stdout.fileno(): line = proc.stdout.readline() if len(line) > 0: - proc_logger.info(line[:-1]) + stdout_logger.info(line[:-1]) if rfd == proc.stderr.fileno(): line = proc.stderr.readline() if len(line) > 0: - proc_logger.info(line[:-1]) + stderr_logger.info(line[:-1]) if event & select.POLLHUP: poll.unregister(rfd) pollc -= 1 -- cgit v1.2.3