From: Ian Kelling Date: Sat, 27 Apr 2024 21:40:49 +0000 (-0400) Subject: backup improvement X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=b5c66cce3ad6c20280958da89f90fb13f74bd721;p=distro-setup backup improvement --- diff --git a/btrbk-run b/btrbk-run index ae16266..b4bd302 100644 --- a/btrbk-run +++ b/btrbk-run @@ -113,12 +113,21 @@ add-x3-target() { fi } -add-wireless-target-h() { - if ping -q -c1 -w1 $h.b8.nz &>/dev/null; then - targets+=($h.b8.nz) - elif ping -q -c1 -w1 ${h}w.b8.nz &>/dev/null; then - targets+=(${h}w.b8.nz) +add-wireless-target() { + local host + if [[ ! $1 ]]; then + set -- $h fi + for host; do + # c = cabled, w = wireless + if ping -q -c1 -w1 ${host}c.b8.nz &>/dev/null; then + targets+=(${host}c.b8.nz) + elif ping -q -c1 -w1 $host.b8.nz &>/dev/null; then + targets+=($host.b8.nz) + elif ping -q -c1 -w1 ${host}w.b8.nz &>/dev/null; then + targets+=(${host}w.b8.nz) + fi + done } qconf() { @@ -288,8 +297,7 @@ if $kd_spread; then fi cmd_arg=resume preserve_arg=-p - h=sy - add-wireless-target-h + add-wireless-target sy so fi if [[ ! $cmd_arg ]]; then @@ -370,7 +378,7 @@ if [[ ! -v targets && ! $source ]]; then ) for h in ${wireless_home_hosts[@]}; do if [[ $HOSTNAME != "$h" ]]; then - add-wireless-target-h + add-wireless-target fi done elif $at_work; then @@ -612,7 +620,7 @@ df --output=size,pcent / | tail -n1" min_root_kb=$(( 1024 * 1024 * 200 )) # 200 gb tmp=$(( root_size < min_root_kb )) if (( tmp )); then - e "warning: $h: root_size=$root_zie < 200gb, perhaps it is booted to bootstrap vol. skipping for now" + e "warning: $h: root_size=$root_size < 200gb, perhaps it is booted to bootstrap vol. skipping for now" continue fi