Add BORGMATIC_NAME as environment variable to service file which exposes the config name to the scripts

This commit is contained in:
Alexander Schäferdiek 2021-12-22 15:59:42 +01:00
parent f15d0c6965
commit 0fed3a2d76
8 changed files with 8 additions and 0 deletions

View file

@ -10,6 +10,7 @@ Type=oneshot
ExecStart=borgmatic check --only repository --only archives --syslog-verbosity 1 --config %h/.config/borgmatic/%I.yml 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="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:%h/.bin"
Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh" Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh"
Environment="BORGMATIC_NAME=%I"
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View file

@ -10,6 +10,7 @@ Type=oneshot
ExecStart=borgmatic create --syslog-verbosity 1 --config %h/.config/borgmatic/%I.yml 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="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:%h/.bin"
Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh" Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh"
Environment="BORGMATIC_NAME=%I"
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View file

@ -10,6 +10,7 @@ Type=oneshot
ExecStart=borgmatic prune --syslog-verbosity 1 --config %h/.config/borgmatic/%I.yml 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="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:%h/.bin"
Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh" Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh"
Environment="BORGMATIC_NAME=%I"
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View file

@ -10,6 +10,7 @@ Type=oneshot
ExecStart=borgmatic --syslog-verbosity 1 --config %h/.config/borgmatic/%I.yml 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="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:%h/.bin"
Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh" Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh"
Environment="BORGMATIC_NAME=%I"
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View file

@ -10,6 +10,7 @@ Type=oneshot
ExecStart=borgmatic check --only repository --only archives --syslog-verbosity 1 --config %h/.config/borgmatic/%I.yml 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="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:%h/.bin"
Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh" Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh"
Environment="BORGMATIC_NAME=%I"
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View file

@ -10,6 +10,7 @@ Type=oneshot
ExecStart=borgmatic create --syslog-verbosity 1 --config %h/.config/borgmatic/%I.yml 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="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:%h/.bin"
Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh" Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh"
Environment="BORGMATIC_NAME=%I"
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View file

@ -10,6 +10,7 @@ Type=oneshot
ExecStart=borgmatic prune --syslog-verbosity 1 --config %h/.config/borgmatic/%I.yml 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="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:%h/.bin"
Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh" Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh"
Environment="BORGMATIC_NAME=%I"
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View file

@ -10,6 +10,7 @@ Type=oneshot
ExecStart=borgmatic --syslog-verbosity 1 --config %h/.config/borgmatic/%I.yml 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="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:%h/.bin"
Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh" Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh"
Environment="BORGMATIC_NAME=%I"
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target