Ensure restic gets the correct permissions when it's updated

Yes it's weird to modify the system package like this, but it's very handy.

See also https://restic.readthedocs.io/en/stable/080_examples.html#backing-up-your-system-without-running-restic-as-root
This commit is contained in:
Jake Howard
2021-08-10 08:45:59 +01:00
parent ab46c30df2
commit e421657619
3 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,14 @@
#!/usr/bin/env bash
# See https://restic.readthedocs.io/en/stable/080_examples.html#backing-up-your-system-without-running-restic-as-root
set -e
RESTIC_BIN=$(which restic)
# Set owner
chown root:restic $RESTIC_BIN
chmod 750 $RESTIC_BIN
# Lest restic run root things
setcap cap_dac_read_search=+ep $RESTIC_BIN