make bbk account for cronjobs
[distro-setup] / brc
diff --git a/brc b/brc
index 487ee8f1dae06254b7bc6280e0053d8c18423c3b..78d28e3b59370a4cdf6b6877e9cee7cae27796c1 100644 (file)
--- a/brc
+++ b/brc
@@ -342,9 +342,20 @@ b() {
 
 bbk() {
   c /
+  local active=true
+  if systemctl is-active btrbk.service; then
+    echo "cron btrbk is already running"
+    return 1
+  fi
+  systemctl is-active btrbk.timer || active=false
+  if $active; then
+    ser disable btrbk.timer
+  fi
   # run latest
   install-my-scripts
-  btrbk-run "$@"
+  if ! btrbk-run "$@" && $active; then
+    ser enable btrbk.timer
+  fi
 }
 
 bfg() { java -jar /a/opt/bfg-1.12.14.jar "$@"; }
@@ -353,19 +364,11 @@ bigclock() {
   xclock -digital -update 1 -face 'arial black-80:bold'
 }
 
-bpush() {
-  case $HOSTNAME in
-    tp) target=x2 ;;
-    x2) target=tp ;;
-  esac
-  btrbk-run -t $target && switch-mail-host $HOSTNAME $target
-}
 bpull() {
-  case $HOSTNAME in
-    tp) source=x2 ;;
-    x2) source=tp ;;
-  esac
-  btrbk-run -s $source && switch-mail-host $source $HOSTNAME
+  c /
+  # run latest
+  install-my-scripts
+  switch-mail-host $1 $HOSTNAMEs
 }
 
 btc() {
@@ -1100,6 +1103,7 @@ jtail() {
   journalctl -n 10000 -f "$@" | jfilter
 }
 jr() { journalctl "$@" | jfilter | less ; }
+jrf() { journalctl -f "$@" | jfilter; }
 
 kff() { # keyboardio firmware flash
   pushd /a/bin/distro-setup/Arduino/Model01-Firmware