From 21dfd6b42d556bc640792926a450fae0a3ea6562 Mon Sep 17 00:00:00 2001 From: akanealw Date: Tue, 10 Oct 2023 18:39:21 -0500 Subject: [PATCH] added check for truenas to be online --- restic/wrestic-backup-to-truenas.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/restic/wrestic-backup-to-truenas.sh b/restic/wrestic-backup-to-truenas.sh index 270375e..1e111a8 100644 --- a/restic/wrestic-backup-to-truenas.sh +++ b/restic/wrestic-backup-to-truenas.sh @@ -1,3 +1,10 @@ #!/bin/bash -sudo wrestic backup +if ping -c 1 192.168.1.41 > /dev/null 2>&1 + then + if [[ ! -d /mnt/truenas-backups/archivebackups ]] + then + sudo wrestic backup + else + echo "TrueNAS is offline" + fi