better fitting of dirs for backup theseus
This commit is contained in:
parent
2298b9b518
commit
a067395694
|
@ -3,7 +3,8 @@
|
||||||
if [[ -z "${BORG_PASSPHRASE}" ]]; then
|
if [[ -z "${BORG_PASSPHRASE}" ]]; then
|
||||||
echo 'BORG_PASSPHRASE is not set, `export BORG_PASSPHRASE=PASS`'
|
echo 'BORG_PASSPHRASE is not set, `export BORG_PASSPHRASE=PASS`'
|
||||||
fi
|
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:
|
# some helpers and error handling:
|
||||||
info() { printf "\n%s %s\n\n" "$( date )" "$*" >&2; }
|
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
|
# 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_BIN create \
|
||||||
--verbose \
|
--verbose \
|
||||||
--filter AME \
|
--filter AME \
|
||||||
--list \
|
--list \
|
||||||
|
@ -23,15 +24,12 @@ info "Starting backup"
|
||||||
--compression zstd,11 \
|
--compression zstd,11 \
|
||||||
--exclude-caches \
|
--exclude-caches \
|
||||||
--exclude 'home/*/.cache/*' \
|
--exclude 'home/*/.cache/*' \
|
||||||
--exclude 'var/tmp/*' \
|
--exclude 'home/.local/share/Steam/*' \
|
||||||
--exclude 'var/cache/*' \
|
|
||||||
--exclude 'srv/data/backup' \
|
|
||||||
--exclude '*/.Trash*' \
|
--exclude '*/.Trash*' \
|
||||||
\
|
\
|
||||||
::'{hostname}-{now}' \
|
::'{hostname}-{now}' \
|
||||||
/home \
|
/home \
|
||||||
/etc \
|
/etc
|
||||||
/var
|
|
||||||
|
|
||||||
backup_exit=$?
|
backup_exit=$?
|
||||||
|
|
||||||
|
@ -42,7 +40,7 @@ info "Pruning repository"
|
||||||
# limit prune's operation to this machine's archives and not apply to
|
# limit prune's operation to this machine's archives and not apply to
|
||||||
# other machines' archives also:
|
# other machines' archives also:
|
||||||
|
|
||||||
/usr/local/bin/borg prune \
|
$BORG_BIN prune \
|
||||||
--list \
|
--list \
|
||||||
--glob-archives '{hostname}-*' \
|
--glob-archives '{hostname}-*' \
|
||||||
--show-rc \
|
--show-rc \
|
||||||
|
@ -56,7 +54,7 @@ prune_exit=$?
|
||||||
|
|
||||||
info "Compacting repository"
|
info "Compacting repository"
|
||||||
|
|
||||||
/usr/local/bin/borg compact
|
$BORG_BIN compact
|
||||||
|
|
||||||
compact_exit=$?
|
compact_exit=$?
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue