start-borg-backups.sh (452B)
1 #!/bin/bash 2 3 set -eu 4 5 if [ -z ${BORG_PASSPHRASE:-} ] 6 then 7 echo "You need to set the BORG_PASSPHRASE in your environment before running this script!" 8 exit 1 9 fi 10 11 if [ -z ${1:-} ] 12 then 13 echo "Call with 'spec' or another host/group to select target" 14 exit 1 15 fi 16 ansible-playbook \ 17 --verbose \ 18 --extra-vars BORG_PASSPHRASE="$BORG_PASSPHRASE" \ 19 --inventory inventories/default \ 20 --limit "${1:-spec}" \ 21 playbooks/borg-start.yml 22 23 exit 0