# targets, plus any given on the command line.
-amy=false
+
+kd_spread=false
# set default targets
if [[ ! -v targets && ! $source ]]; then
- if [[ $HOSTNAME != "$MAIL_HOST" ]] && $cron ; then
- echo "MAIL_HOST=$MAIL_HOST, nothing to do"
- mexit 0
- else
- amy=true
+ if $cron; then
+ if [[ $HOSTNAME != "$MAIL_HOST" ]]; then
+ if [[ $HOSTNAME == kd && $MAIL_HOST = x2 ]]; then
+ kd_spread=true
+ else
+ echo "MAIL_HOST=$MAIL_HOST, nothing to do"
+ mexit 0
+ fi
+ fi
fi
+ # x2 at home atm
+ kd_spread=false
+
at_work=false
# todo, fix this up once frodo is back
# targets=(frodo.b8.nz)
case $HOSTNAME in
- x2|kw)
+ kw)
at_work=true
;;&
x2|x3|sy|bo)
home=i.b8.nz
fi
else
- home=b8.nz
+ if ping -q -c1 -w1 b8.nz &>/dev/null; then
+ home=b8.nz
+ else
+ home=i.b8.nz
+ fi
fi
;;&
x2)
fi
;;
kd)
- if ping -q -c1 -w1 x2.office.fsf.org &>/dev/null; then
- targets+=(x2.office.fsf.org)
- else
- targets+=(x2wg.b8.nz)
+ if ! $kd_spread; then
+ if ping -q -c1 -w1 x2.office.fsf.org &>/dev/null; then
+ targets+=(x2.office.fsf.org)
+ else
+ targets+=(x2wg.b8.nz)
+ fi
fi
if ping -q -c1 -w1 sy.b8.nz &>/dev/null; then
targets+=(sy.b8.nz)
transaction_syslog local7
# trying this out
-stream_compress zstd
+#stream_compress zstd
# so we only run one at a time
lockfile /var/lock/btrbk.lock
fi
done
-# if $amy; then
-# # to manually backup amy,
-# # bbk -e -s amy -m root_ubuntubionic
-# cat >>/etc/btrbk.conf <<'EOF'
-# volume ssh://amy/mnt/root
-# subvolume root_ubuntubionic
-# target send-receive /mnt/root/btrbk
-# EOF
-# fi
-
# todo: umount first to ensure we don't have any errors
# todo: do some kill fuser stuff to make umount more reliable