diff options
author | Oscar Najera <hi@oscarnajera.com> | 2024-03-01 16:48:17 +0100 |
---|---|---|
committer | Oscar Najera <hi@oscarnajera.com> | 2024-04-01 01:40:43 +0200 |
commit | b608d806a57b0422393afd3fef1a437ba5cdfaa9 (patch) | |
tree | f11b64afe4904bb89ce6ca5efe2bc0a7082b2ee0 | |
parent | 6d0820bee59fb94712dec94975cc7a8f2f0c9bb8 (diff) | |
download | dotfiles-b608d806a57b0422393afd3fef1a437ba5cdfaa9.tar.gz dotfiles-b608d806a57b0422393afd3fef1a437ba5cdfaa9.tar.bz2 dotfiles-b608d806a57b0422393afd3fef1a437ba5cdfaa9.zip |
backup to raspberry only if online
-rwxr-xr-x | bin/backup.sh | 4 |
1 files changed, 3 insertions, 1 deletions
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 |