From 46adb986f6068b13c086a15aad90a42fcbe099c0 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Wed, 15 May 2019 16:41:54 -0400 Subject: [PATCH] make bbk account for cronjobs --- brc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/brc b/brc index e740a8d..78d28e3 100644 --- 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 "$@"; } -- 2.30.2