From 0fed3a2d76d345da7dd5448a12f31f6ba599d973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Sch=C3=A4ferdiek?= Date: Wed, 22 Dec 2021 15:59:42 +0100 Subject: [PATCH] Add BORGMATIC_NAME as environment variable to service file which exposes the config name to the scripts --- etc/systemd/system/borgmatic-check@.service | 1 + etc/systemd/system/borgmatic-create@.service | 1 + etc/systemd/system/borgmatic-prune@.service | 1 + etc/systemd/system/borgmatic@.service | 1 + etc/systemd/user/borgmatic-check@.service | 1 + etc/systemd/user/borgmatic-create@.service | 1 + etc/systemd/user/borgmatic-prune@.service | 1 + etc/systemd/user/borgmatic@.service | 1 + 8 files changed, 8 insertions(+) diff --git a/etc/systemd/system/borgmatic-check@.service b/etc/systemd/system/borgmatic-check@.service index 30cc8dd..e29c557 100644 --- a/etc/systemd/system/borgmatic-check@.service +++ b/etc/systemd/system/borgmatic-check@.service @@ -10,6 +10,7 @@ Type=oneshot ExecStart=borgmatic check --only repository --only archives --syslog-verbosity 1 --config %h/.config/borgmatic/%I.yml Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:%h/.bin" Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh" +Environment="BORGMATIC_NAME=%I" [Install] WantedBy=multi-user.target diff --git a/etc/systemd/system/borgmatic-create@.service b/etc/systemd/system/borgmatic-create@.service index f6767e3..bb01ca5 100644 --- a/etc/systemd/system/borgmatic-create@.service +++ b/etc/systemd/system/borgmatic-create@.service @@ -10,6 +10,7 @@ Type=oneshot ExecStart=borgmatic create --syslog-verbosity 1 --config %h/.config/borgmatic/%I.yml Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:%h/.bin" Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh" +Environment="BORGMATIC_NAME=%I" [Install] WantedBy=multi-user.target diff --git a/etc/systemd/system/borgmatic-prune@.service b/etc/systemd/system/borgmatic-prune@.service index 82d3141..f577ecd 100644 --- a/etc/systemd/system/borgmatic-prune@.service +++ b/etc/systemd/system/borgmatic-prune@.service @@ -10,6 +10,7 @@ Type=oneshot ExecStart=borgmatic prune --syslog-verbosity 1 --config %h/.config/borgmatic/%I.yml Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:%h/.bin" Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh" +Environment="BORGMATIC_NAME=%I" [Install] WantedBy=multi-user.target diff --git a/etc/systemd/system/borgmatic@.service b/etc/systemd/system/borgmatic@.service index 32ef46a..e1556a2 100644 --- a/etc/systemd/system/borgmatic@.service +++ b/etc/systemd/system/borgmatic@.service @@ -10,6 +10,7 @@ Type=oneshot ExecStart=borgmatic --syslog-verbosity 1 --config %h/.config/borgmatic/%I.yml Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:%h/.bin" Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh" +Environment="BORGMATIC_NAME=%I" [Install] WantedBy=multi-user.target diff --git a/etc/systemd/user/borgmatic-check@.service b/etc/systemd/user/borgmatic-check@.service index 30cc8dd..e29c557 100644 --- a/etc/systemd/user/borgmatic-check@.service +++ b/etc/systemd/user/borgmatic-check@.service @@ -10,6 +10,7 @@ Type=oneshot ExecStart=borgmatic check --only repository --only archives --syslog-verbosity 1 --config %h/.config/borgmatic/%I.yml Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:%h/.bin" Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh" +Environment="BORGMATIC_NAME=%I" [Install] WantedBy=multi-user.target diff --git a/etc/systemd/user/borgmatic-create@.service b/etc/systemd/user/borgmatic-create@.service index f6767e3..bb01ca5 100644 --- a/etc/systemd/user/borgmatic-create@.service +++ b/etc/systemd/user/borgmatic-create@.service @@ -10,6 +10,7 @@ Type=oneshot ExecStart=borgmatic create --syslog-verbosity 1 --config %h/.config/borgmatic/%I.yml Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:%h/.bin" Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh" +Environment="BORGMATIC_NAME=%I" [Install] WantedBy=multi-user.target diff --git a/etc/systemd/user/borgmatic-prune@.service b/etc/systemd/user/borgmatic-prune@.service index 82d3141..f577ecd 100644 --- a/etc/systemd/user/borgmatic-prune@.service +++ b/etc/systemd/user/borgmatic-prune@.service @@ -10,6 +10,7 @@ Type=oneshot ExecStart=borgmatic prune --syslog-verbosity 1 --config %h/.config/borgmatic/%I.yml Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:%h/.bin" Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh" +Environment="BORGMATIC_NAME=%I" [Install] WantedBy=multi-user.target diff --git a/etc/systemd/user/borgmatic@.service b/etc/systemd/user/borgmatic@.service index 32ef46a..e1556a2 100644 --- a/etc/systemd/user/borgmatic@.service +++ b/etc/systemd/user/borgmatic@.service @@ -10,6 +10,7 @@ Type=oneshot ExecStart=borgmatic --syslog-verbosity 1 --config %h/.config/borgmatic/%I.yml Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:%h/.bin" Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh" +Environment="BORGMATIC_NAME=%I" [Install] WantedBy=multi-user.target