better fitting of dirs for backup theseus

This commit is contained in:
Christoph J. Scherr 2023-06-11 00:57:34 +02:00
parent 2298b9b518
commit a067395694
Signed by: PlexSheep
GPG Key ID: 25B4ACF7D88186CC
1 changed files with 7 additions and 9 deletions

View File

@ -3,7 +3,8 @@
if [[ -z "${BORG_PASSPHRASE}" ]]; then
echo 'BORG_PASSPHRASE is not set, `export BORG_PASSPHRASE=PASS`'
fi
export BORG_REPO=plex@homeserver.box:/srv/data/backup/borg/theseus
export BORG_REPO=fileserver@homeserver.box:/srv/data/backup/borg/theseus
export BORG_BIN="$(which borg)"
# some helpers and error handling:
info() { printf "\n%s %s\n\n" "$( date )" "$*" >&2; }
@ -14,7 +15,7 @@ info "Starting backup"
# Backup the most important directories into an archive named after
# the machine this script is currently running on:
/usr/local/bin/borg create \
$BORG_BIN create \
--verbose \
--filter AME \
--list \
@ -23,15 +24,12 @@ info "Starting backup"
--compression zstd,11 \
--exclude-caches \
--exclude 'home/*/.cache/*' \
--exclude 'var/tmp/*' \
--exclude 'var/cache/*' \
--exclude 'srv/data/backup' \
--exclude 'home/.local/share/Steam/*' \
--exclude '*/.Trash*' \
\
::'{hostname}-{now}' \
/home \
/etc \
/var
/etc
backup_exit=$?
@ -42,7 +40,7 @@ info "Pruning repository"
# limit prune's operation to this machine's archives and not apply to
# other machines' archives also:
/usr/local/bin/borg prune \
$BORG_BIN prune \
--list \
--glob-archives '{hostname}-*' \
--show-rc \
@ -56,7 +54,7 @@ prune_exit=$?
info "Compacting repository"
/usr/local/bin/borg compact
$BORG_BIN compact
compact_exit=$?