avoid multiple time zones
authorIan Kelling <iank@fsf.org>
Mon, 29 Apr 2019 17:39:47 +0000 (13:39 -0400)
committerIan Kelling <iank@fsf.org>
Mon, 29 Apr 2019 17:39:47 +0000 (13:39 -0400)
btrbk-run

index 50106a21df71e58de59c904e690fcb70ef1ad31d..f0f16bda44f3013bc48ec4ed10c1c1955cbd8d9c 100644 (file)
--- 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
 
 
 done