Merge branch 'dev' into main

This commit is contained in:
Marc Koch 2023-09-06 18:07:09 +02:00
commit 2332c6c64a
2 changed files with 14 additions and 11 deletions

View File

@ -14,6 +14,9 @@ export BORG_PASSPHRASE="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# This array must containing everything you want to include in the backup
export BORG_TARGETS=("$HOME")
# Exclude directories and files
export BORG_EXCLUDE=("$HOME/.config/borg" "$HOME/.cache" "*.db")
# [optional] Use a ntfy service to publish backup results
# export NTFY=true

View File

@ -47,20 +47,20 @@ trap 'echo $( date ) Backup interrupted >&2; exit 2' INT TERM
info "Starting backup"
exclude() {
for entry in "${BORG_EXCLUDE[@]}"; do
echo "--exclude $entry"
done
}
# Backup the most important directories into an archive named after
# the machine this script is currently running on:
/usr/local/bin/borg create \
--verbose \
--filter AME \
--list \
--stats \
--show-rc \
--compression lz4 \
--exclude-caches \
\
::"${mode}-{hostname}-{now}" \
"${BORG_TARGETS[@]}" \
borg_command=("create" "--verbose" "--filter=AME" "--list" "--stats" "--show-rc" "--compression=lz4" "--exclude-caches")
borg_command+=($(exclude))
borg_command+=("::backup-{hostname}-{now}" "${BORG_TARGETS[@]}")
/usr/local/bin/borg "${borg_command[@]}"
backup_exit=$?