borgthismachine: use parameter as config file

This commit is contained in:
layman 2021-07-08 13:13:59 +02:00
parent b367288d39
commit 225b4325b7
No known key found for this signature in database
GPG key ID: 92D2BF778E1308C0

View file

@ -6,7 +6,7 @@ fi
HOME=${HOME:-"/root/"}
PERSONALCONFIG="$HOME/.config/borg.conf"
PERSONALCONFIG="${1:-$HOME/.config/borg.conf}"
BORGHOST=""
USER=""
@ -14,6 +14,7 @@ REPO=""
MAC=""
BORG_PASSPHRASE=""
BORG_EXCLUDE_FILE=""
BORG_EXCLUDE_IF_PRESENT=".do_not_backup_this_directory"
BORG_EXCLUDE_PATTERN=("/var/cache/*"
"/var/tmp/*"
)
@ -66,6 +67,7 @@ nice ionice -c 3 borg create --stats \
${BORG_ARGS} \
$([[ -n "${BORG_EXCLUDE_PATTERN[*]}" ]] && printf " --exclude \"%s\" " "${BORG_EXCLUDE_PATTERN[@]}" ) \
$([[ -n "$BORG_EXCLUDE_FILE" ]] && printf " --exclude-from \"%s\" " "${BORG_EXCLUDE_FILE}" ) \
--exclude-if-present="$BORG_EXCLUDE_IF_PRESENT" \
"${MYREPO}::${SNAPSHOT}" \
"${BORG_BACKUP_DIRS[@]}"