From: Ian Kelling Date: Wed, 15 May 2019 20:41:54 +0000 (-0400) Subject: make bbk account for cronjobs X-Git-Url: https://iankelling.org/git/?p=distro-setup;a=commitdiff_plain;h=46adb986f6068b13c086a15aad90a42fcbe099c0 make bbk account for cronjobs --- 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 "$@"; }