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
/err
14 echo "$0: error: no \$1 given, should be old host"
18 if ! timeout
-s 9 2 ssh $old : ; then
19 echo "$0: error: can't ssh to $old"
22 for p
in emacs firefox pidgin
; do
23 ssh $old killall
$p ||
:
26 # note: duplicated in check-subvol-stale
29 for s
in /mnt
/root
/btrbk
/$vol.
*; do
31 unix_time
=$
(date -d $
(sed -r 's/(.{4})(..)(.{5})(..)(.*)/\1-\2-\3:\4:\5/' <<<${f#$vol.}) +%s
)
32 printf "%s\n" $unix_time
33 done |
sort -r |
head -n 1
36 if [[ $last_a != [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] ]]; then
37 echo "$0: error: last_a bad value: $last_a"
41 # if last_a is recent enough, skip doing btrbk
42 if (( last_a
< $
(date +%s
) - 60*60 )); then
43 if ! ssh $old btrbk-run
-pvt $new; then
44 echo "$0: error: failed btrbk-run"
49 switch-mail-host
$old $new