My backup scripts and tools
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

22 lines
645 B

  1. #!/bin/bash
  2. set -e
  3. . "$(dirname "$0")"/vars.sh
  4. export BORG_PASSCOMMAND="cat ${BORG_DIR}/passphrase"
  5. export BORG_BASE_DIR=${BORG_DIR}
  6. export BORG_CACHE_DIR=${BORG_DIR}/cache
  7. export BORG_CONFIG_DIR=${BORG_DIR}/config
  8. if [ "$1" = "--rw" ] ; then
  9. if [ "$BORG_RW_KEY_ADDED" != "1" ] ; then
  10. echo "=== Need SSH key passphrase. Check Bitwarden for:"
  11. echo "=== borg $HOSTNAME / read-write SSH key"
  12. fi
  13. export BORG_RSH="ssh -F $SSH/config -o BatchMode=no -o PreferredAuthentications=publickey -i $SSH/id_ecdsa"
  14. shift
  15. else
  16. export BORG_RSH="ssh -F $SSH/config -i $SSH/id_ecdsa_appendonly"
  17. fi
  18. exec "${BORG_BIN}" "$@"