Compare commits

...

4 Commits
main ... dev

Author SHA1 Message Date
Marc Koch fbcc00b070 fix --compression=lz4 2023-09-06 18:01:21 +02:00
Marc Koch 88cb299e03 fix --filter=AME 2023-09-06 18:00:13 +02:00
Marc Koch 0edf08d93e fix borg command 2023-09-06 17:58:05 +02:00
Marc Koch 9092922440 implement an environment variable to exclude stuff 2023-09-06 17:52:22 +02:00
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 # This array must containing everything you want to include in the backup
export BORG_TARGETS=("$HOME") 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 # [optional] Use a ntfy service to publish backup results
# export NTFY=true # export NTFY=true

View File

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