3 source /a
/bin
/errhandle
/errcatch-function
4 source /a
/bin
/errhandle
/bash-trace-function
13 echo "$0: error: no \$1 given, should be old host"
17 if ! timeout
-s 9 2 ssh $old : ; then
18 echo "$0: error: can't ssh to $old"
21 for p
in emacs firefox pidgin
; do
22 ssh $old killall
$p ||
:
25 # note: duplicated in check-subvol-stale
28 for s
in /mnt
/root
/btrbk
/$vol.
*; do
30 unix_time
=$
(date -d $
(sed -r 's/(.{4})(..)(.{5})(..)(.*)/\1-\2-\3:\4:\5/' <<<${f#$vol.}) +%s
)
31 printf "%s\n" $unix_time
32 done |
sort -r |
head -n 1
35 if [[ $last_a != [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] ]]; then
36 echo "$0: error: last_a bad value: $last_a"
40 # if last_a is recent enough, skip doing btrbk
41 if (( last_a
< $
(date +%s
) - 60*60 )); then
42 if ! ssh $old btrbk-run
-pvt $new; then
43 echo "$0: error: failed btrbk-run"
48 switch-mail-host
$old $new