Skip to content

Commit

Permalink
rsync: ping before trying ssh
Browse files Browse the repository at this point in the history
Change d6fed34 modified the archive
reachable check to use ssh instead of ping. This is much more resource
intensive though, so change it to try a ping first, and ssh only if the
ping fails.
  • Loading branch information
marcone committed Jul 16, 2024
1 parent 440bb42 commit 88ec432
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion run/rsync_archive/archive-is-reachable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

ARCHIVE_HOST_NAME="$1"

ssh -q -o ConnectTimeout=1 "$RSYNC_USER"@"$ARCHIVE_HOST_NAME" exit
ping -q -w 1 -c 1 "$ARCHIVE_HOST_NAME" &> /dev/null || ssh -q -o ConnectTimeout=1 "$RSYNC_USER"@"$ARCHIVE_HOST_NAME" exit

0 comments on commit 88ec432

Please sign in to comment.