From a067395694391590e3c83a7a37579f265970f257 Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Sun, 11 Jun 2023 00:57:34 +0200 Subject: [PATCH] better fitting of dirs for backup theseus --- backup-theseus.sh | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/backup-theseus.sh b/backup-theseus.sh index 8d6d47b..153f877 100755 --- a/backup-theseus.sh +++ b/backup-theseus.sh @@ -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=$?