Minor visual cleanup

dev
root 2017-01-20 11:57:43 +01:00
parent 7798ccdfc8
commit ffd4d55991
1 changed files with 14 additions and 14 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
MODE="$1" MODE="${1}"
CONFIG="/etc/borgwrapper/config.sh" CONFIG="/etc/borgwrapper/config.sh"
@ -15,10 +15,10 @@ borg_backup () {
EXCLUDE_CMD=() EXCLUDE_CMD=()
for EXCLUDE in ${EXCLUDES[@]}; do for EXCLUDE in ${EXCLUDES[@]}; do
EXCLUDE_CMD+=( --exclude "$EXCLUDE" ) EXCLUDE_CMD+=( --exclude "${EXCLUDE}" )
done done
$BORG create --info --stats \ ${BORG} create --info --stats \
--compression lz4 \ --compression lz4 \
--numeric-owner \ --numeric-owner \
"${REPO}"::"{hostname}-$(date -u +'%Y%m%dT%H%M%SZ')" \ "${REPO}"::"{hostname}-$(date -u +'%Y%m%dT%H%M%SZ')" \
@ -30,34 +30,34 @@ borg_prune () {
# Use --prefix to limit pruning to this hostname's archives only, just in # Use --prefix to limit pruning to this hostname's archives only, just in
# case you for some reason use the same repository for several hosts (not # case you for some reason use the same repository for several hosts (not
# recommended) # recommended)
$BORG prune --info --stats --list \ ${BORG} prune --info --stats --list \
--prefix "{hostname}-" \ --prefix "{hostname}-" \
--keep-daily=$KEEP_DAILY \ --keep-daily=${KEEP_DAILY} \
--keep-weekly=$KEEP_WEEKLY \ --keep-weekly=${KEEP_WEEKLY} \
--keep-monthly=$KEEP_MONTHLY \ --keep-monthly=${KEEP_MONTHLY} \
--keep-yearly=$KEEP_YEARLY \ --keep-yearly=${KEEP_YEARLY} \
"${REPO}" "${REPO}"
} }
borg_verify () { borg_verify () {
$BORG check --info "${REPO}" ${BORG} check --info "${REPO}"
} }
borg_unlock () { borg_unlock () {
# Use if borgbackup is not shut down cleanly and complains about lock files # Use if borgbackup is not shut down cleanly and complains about lock files
$BORG break-lock "${REPO}" ${BORG} break-lock "${REPO}"
} }
source "$CONFIG" || exit 1 source "${CONFIG}" || exit 1
export BORG_PASSPHRASE export BORG_PASSPHRASE
if [[ $MODE == "backup" ]]; then if [[ ${MODE} == "backup" ]]; then
borg_backup borg_backup
borg_prune borg_prune
elif [[ $MODE == "verify" ]]; then elif [[ ${MODE} == "verify" ]]; then
borg_verify borg_verify
elif [[ $MODE == "unlock" ]]; then elif [[ ${MODE} == "unlock" ]]; then
borg_unlock borg_unlock
else else
print_usage print_usage