From 519541561d2d79b45dbd2fa8c6735a5ad240ab23 Mon Sep 17 00:00:00 2001 From: deajan Date: Wed, 12 Feb 2025 12:53:00 +0100 Subject: [PATCH] Add NPBACKUP_BACKEND_BINARY as env variable --- npbackup/core/runner.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/npbackup/core/runner.py b/npbackup/core/runner.py index 3e4bd66..53c0eb3 100644 --- a/npbackup/core/runner.py +++ b/npbackup/core/runner.py @@ -912,6 +912,15 @@ class NPBackupRunner: self.write_logs("No backend binary found", level="error") self._is_ready = False return False + + # Add currently in use backend binary to environment variables + # This is useful for additional parameters / scripts that would directly call the backend + try: + os.environ["NPBACKUP_BACKEND_BINARY"] = str(self.restic_runner.binary) + except OSError: + self.write_logs( + f"Cannot set env variable NPBACKUP_BACKEND_BINARY to {self.binary}", level="error" + ) return True def convert_to_json_output(