|
|
@@ -81,7 +81,7 @@ create_borg_wrapper() |
|
|
|
#!/bin/sh |
|
|
|
|
|
|
|
export BORG_REPO=${BORG_REPO} |
|
|
|
export BORG_PASSCOMMAND=${BORG_DIR}/print-passphrase |
|
|
|
export BORG_PASSCOMMAND="cat ${BORG_DIR}/passphrase" |
|
|
|
export BORG_HOST_ID=${HOSTID} |
|
|
|
export BORG_BASE_DIR=${BORG_DIR} |
|
|
|
export BORG_CACHE_DIR=${BORG_DIR}/cache |
|
|
@@ -105,11 +105,8 @@ generate_keys() |
|
|
|
{ |
|
|
|
PASS_SSH=$(print_random_key) |
|
|
|
PASS_REPOKEY=$(print_random_key) |
|
|
|
cat >"${BORG_DIR}/print-passphrase" <<EOF |
|
|
|
#!/bin/sh |
|
|
|
echo $PASS_REPOKEY |
|
|
|
EOF |
|
|
|
chmod 700 "${BORG_DIR}/print-passphrase" |
|
|
|
echo "$PASS_REPOKEY" > "${BORG_DIR}/passphrase" |
|
|
|
chmod 600 "${BORG_DIR}/passphrase" |
|
|
|
} |
|
|
|
|
|
|
|
# Run a command on the remote host over an existing SSH tunnel |
|
|
@@ -227,7 +224,7 @@ set -e |
|
|
|
# from different filesystems. If not, duplicates have no effect. |
|
|
|
DIRS="/" |
|
|
|
for DIR in /usr /var /home /boot /efi ; do |
|
|
|
if [ -e $DIR ] ; then |
|
|
|
if [ -e "\$DIR" ] ; then |
|
|
|
DIRS="\$DIRS \$DIR" |
|
|
|
fi |
|
|
|
done |
|
|
@@ -290,6 +287,10 @@ fi |
|
|
|
echo "Unmount with: fusermount -u \$1" |
|
|
|
|
|
|
|
EOF |
|
|
|
|
|
|
|
chmod 755 "${BORG_DIR}/backup.sh" |
|
|
|
chmod 755 "${BORG_DIR}/prune.sh" |
|
|
|
chmod 755 "${BORG_DIR}/mount.sh" |
|
|
|
} |
|
|
|
|
|
|
|
configure_systemd() |
|
|
|