From: Ian Kelling Date: Mon, 29 Apr 2019 17:39:47 +0000 (-0400) Subject: avoid multiple time zones X-Git-Url: https://iankelling.org/git/?p=distro-setup;a=commitdiff_plain;h=7b2ec509be2266c4c9f42727e7db4e7fdd63b7ae avoid multiple time zones --- diff --git a/btrbk-run b/btrbk-run index 50106a2..f0f16bd 100644 --- a/btrbk-run +++ b/btrbk-run @@ -245,9 +245,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