if diff -q $tmpf $BASH_SOURCE; then
echo "$0: found newer version on host $source. reexecing"
install -T $tmpf /usr/local/bin/btrbk-run
- /usr/local/bin/btrbk-run --pull-reexec "${orig_args[@]}"
+ m /usr/local/bin/btrbk-run --pull-reexec "${orig_args[@]}"
+ exit
fi
fi
-for tg in ${targets[@]:-$HOSTNAME}; do
- # for an initial run, btrbk requires the dir to exist.
- ssh root@$tg mkdir -p /mnt/root/btrbk
+# for an initial run, btrbk requires the dir to exist.
+mkdir -p /mnt/root/btrbk
+local_zone=$(date +%z)
+for h in ${targets[@]} $source; do
+ zone=$(ssh root@$h "mkdir -p /mnt/root/btrbk; date +%z")
+ if [[ $zone != $local_zone ]]; then
+ echo "error: error. dont confuse yourself with multiple time zones. $h has different timezone than localhost" >&2
+ exit 1
+ fi
done