fix btrbk timing issue. improve email stuff
[distro-setup] / btrbk-run
index e30c9c3dd3667d259a46e560773890e3919dd9a9..fa20061128281857e82fcfd444225cb147e4158e 100644 (file)
--- a/btrbk-run
+++ b/btrbk-run
@@ -247,7 +247,14 @@ fi
 
 echo "mountpoints: ${mountpoints[*]}"
 
+##### end command line parsing ########
 
+if [[ $source ]]; then
+  if [[ $(ssh $source systemctl is-active btrbk.service) != inactive ]]; then
+    echo "$0: error: cron btrbk is running on source. exiting out of caution"
+    exit 1
+  fi
+fi
 
 # pull_reexec stops us from getting into an infinite loop if there is some
 # kind of weird problem
@@ -270,7 +277,6 @@ if ! $pull_reexec && [[ $source ]] && $pulla ; then
 fi
 
 
-##### end command line parsing ########