X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=btrbk-run;h=59631fdd75efbad9f54733a08b22975e5b5712c8;hb=88d40e435fe7d525e033558101f0c0a8101c27b2;hp=50106a21df71e58de59c904e690fcb70ef1ad31d;hpb=4f13ea60bec1126f54b9da543b549d29d5013a69;p=distro-setup diff --git a/btrbk-run b/btrbk-run index 50106a2..59631fd 100644 --- a/btrbk-run +++ b/btrbk-run @@ -105,7 +105,8 @@ if ! $pull_reexec && [[ $source ]]; then 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 @@ -245,9 +246,15 @@ EOF -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