Change hostname to SYSTEM_NAME user variable as part of repo name, adde beginning

dev
Bryan 2020-09-11 08:18:57 -06:00
parent a14117c4d7
commit b771147456
3 changed files with 19 additions and 4 deletions

View File

@ -64,7 +64,7 @@ borg_backup () {
${BORG} create \
"${BORG_CREATE_ARGS[@]}" \
"${BORG_REPO}"::"{hostname}-$(date -u +'%Y%m%dT%H%M%SZ')" \
"${BORG_REPO}"::"${SYSTEM_NAME}-$(date -u +'%Y-%m-%dT%H-%M-%SZ')" \
"${PATHS[@]}" \
"${EXCLUDE_CMD[@]}"
}
@ -85,7 +85,7 @@ borg_prune () {
${BORG} prune \
"${BORG_PRUNE_ARGS[@]}" \
--prefix "{hostname}-" \
--prefix "${SYSTEM_NAME}-" \
--keep-hourly=${KEEP_HOURLY:-0} \
--keep-daily=${KEEP_DAILY:-0} \
--keep-weekly=${KEEP_WEEKLY:-0} \

View File

@ -1,8 +1,10 @@
#BORG="/usr/bin/borg"
BORG_REPO="<user>@<reposerver>:/srv/borg/$(hostname -f)"
SYSTEM_NAME="name-of-computer"
BORG_REPO="<user>@<reposerver>:/srv/borg/${SYSTEM_NAME}"
# If using a non-standard SSH port ssh:// have to be specified (per borg v1.0.9)
#BORG_REPO="ssh://<user>@<reposerver>:<ssh_port>/srv/borg/$(hostname -f)"
#BORG_REPO="ssh://<user>@<reposerver>:<ssh_port>/srv/borg/${SYSTEM_NAME}"
BORG_PASSPHRASE="longandcomplexpassphrase"
PATHS=(
"/etc"

13
src/install Normal file
View File

@ -0,0 +1,13 @@
#! /bin/bash
cp -i ./borgwrapper /usr/local/bin/borgwrapper
chown root. /usr/local/bin/borgwrapper
chmod 750 /usr/local/bin/borgwrapper
if [! -d /etc/borgwrapper/ ]; then
mkdir /etc/borgwrapper/config
fi
cp -i config /etc/borgwrapper/config
chown root. /etc/borgwrapper/config
chmod 600 /etc/borgwrapper/config