added logic for gauntnas local backup
This commit is contained in:
13
restic.sh
13
restic.sh
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user