exec_borg.sh: pass stdin via systemd_run --pipe

This commit is contained in:
Ludwig Behm 2024-02-17 18:49:53 +01:00
parent f0b481ad1d
commit b32d3b8aa6

View file

@ -18,7 +18,8 @@ usage() {
[ $# == 0 ] && usage
# do some sandboxinng
exec systemd-run --quiet --pipe --collect --unit=temp-borg-init-sandbox.service \
exec systemd-run --quiet --collect --unit=temp-borg-init-sandbox.service \
--pipe < /etc/borg/$NAME/borg_passphrase \
--working-directory=/tmp \
-p "ConfigurationDirectory=borg/$NAME" \
-p "CacheDirectory=borg/$NAME" \
@ -31,4 +32,4 @@ exec systemd-run --quiet --pipe --collect --unit=temp-borg-init-sandbox.service
--setenv=BORG_BASE_DIR=/tmp/ \
--setenv=BORG_CONFIG_DIR=/etc/borg/$NAME \
--setenv=BORG_CACHE_DIR=/var/cache/borg/$NAME \
/usr/bin/borg $@ < /etc/borg/$NAME/borg_passphrase
/usr/bin/borg $@