added logic for gauntnas local backup

This commit is contained in:
2021-08-17 15:49:38 -04:00
parent 1b5af28723
commit ff071d1d30

View File

@@ -3,8 +3,17 @@
LOCKFILE="/tmp/restic.lock"
LOGFILE="/var/log/restic/restic_$(date +%Y%m%d-%H%M%S).log"
LATEST_RESTIC_VERSION="0.12.1"
RESTIC_REPOSITORY="sftp:root@gauntnas.home.johnhgaunt.com:50022:/mnt/restic"
RESTIC_PASSWORD="restic"
LOCAL_RESTIC_REPOSITORY="/mnt/data/backups/restic"
export RESTIC_REPOSITORY="sftp:root@gauntnas.home.johnhgaunt.com:50022:/mnt/restic"
export RESTIC_PASSWORD="restic"
if [ -d ${LOCAL_RESTIC_REPOSITORY} ]; then
restic --repo ${LOCAL_RESTIC_REPOSITORY} snapshots
if [ ${?} == "0" ]; then
export RESTIC_REPOSITORY=${LOCAL_RESTIC_REPOSITORY}
fi
fi
# make log directory
if [ ! -d $(dirname ${LOGFILE}) ]; then