diff --git a/borgthismachine.sh b/borgthismachine.sh index 96dae8e..526a235 100755 --- a/borgthismachine.sh +++ b/borgthismachine.sh @@ -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[@]}"