3 # this pulls from host $1 to the current host.
4 # not currently used, but it might be useful at some point
6 source /a
/bin
/errhandle
/errcatch-function
7 source /a
/bin
/errhandle
/bash-trace-function
16 echo "$0: error: no \$1 given, should be old host"
20 if ! timeout
-s 9 2 ssh $old : ; then
21 echo "$0: error: can't ssh to $old"
24 for p
in emacs firefox pidgin
; do
25 ssh $old killall
$p ||
:
28 # note: duplicated in check-subvol-stale
31 for s
in /mnt
/root
/btrbk
/$vol.
*; do
33 unix_time
=$
(date -d $
(sed -r 's/(.{4})(..)(.{5})(..)(.*)/\1-\2-\3:\4:\5/' <<<${f#$vol.}) +%s
)
34 printf "%s\n" $unix_time
35 done |
sort -r |
head -n 1
38 if [[ $last_a != [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] ]]; then
39 echo "$0: error: last_a bad value: $last_a"
43 # if last_a is recent enough, skip doing btrbk
44 if (( last_a
< $
(date +%s
) - 60*60 )); then
45 if ! ssh $old btrbk-run
-pvt $new; then
46 echo "$0: error: failed btrbk-run"
51 switch-mail-host
$old $new