From b608d806a57b0422393afd3fef1a437ba5cdfaa9 Mon Sep 17 00:00:00 2001 From: Oscar Najera Date: Fri, 1 Mar 2024 16:48:17 +0100 Subject: backup to raspberry only if online --- bin/backup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/backup.sh b/bin/backup.sh index 4ec75a6..9f53249 100755 --- a/bin/backup.sh +++ b/bin/backup.sh @@ -55,6 +55,8 @@ backup_local Admin/sarah/borg/ingrid ssh://borgbackup@sarah/./repos/ingrid "${BA DISK=/run/media/titan/ext_backup if [ -d "$DISK" ]; then LARGER_PATHS=("$DISK/personal/Pictures/" "$DISK/personal/Libros/" "$DISK/personal/dev/" "$DISK/Archives/") - backup_local borgbackup ssh://backup/media/Backup/daily_backup/ "${BASIC_PATHS[@]}" "${LARGER_PATHS[@]}" backup_local Admin/sarah/borg/oscar ssh://borgbackup@sarah/./repos/oscar "${LARGER_PATHS[@]}" + if ping -c 1 -W 1 192.168.178.128 >/dev/null; then + backup_local borgbackup ssh://backup/media/Backup/daily_backup/ "${BASIC_PATHS[@]}" "${LARGER_PATHS[@]}" + fi fi -- cgit v1.2.3