minor improvements
authorIan Kelling <ian@iankelling.org>
Sat, 6 Jul 2024 03:01:30 +0000 (23:01 -0400)
committerIan Kelling <ian@iankelling.org>
Sat, 6 Jul 2024 03:01:30 +0000 (23:01 -0400)
.bashrc
btrbk-run

diff --git a/.bashrc b/.bashrc
index 9e4310fdd63178593c7805310e5bf82dfb1de2d2..ea49780fa79ec7e8983c880bc3c25d36ce268f02 100644 (file)
--- a/.bashrc
+++ b/.bashrc
@@ -55,7 +55,8 @@ HISTIGNORE='pass *:otp *:oathtool *:histrm *'
 umask 022
 
 
-if [[ $EUID == 1000 && $TERM == linux && ! $DISPLAY && $(tty) = /dev/tty1 && -x /usr/bin/startx ]]; then
+if [[ $EUID == 1000 && ! $_ran_bashrc && $TERM == linux && ! $DISPLAY && $(tty) = /dev/tty1 && -x /usr/bin/startx ]]; then
+  _ran_bashrc=t
   if tmp=$(systemctl status |& head) && \
       grep -qi '^ *state: running' <<<"$tmp"  && grep -qi '^ *failed: 0' <<<"$tmp" && grep -qi '^ *jobs: 0' <<<"$tmp"; then
     startx
@@ -66,6 +67,7 @@ if [[ $EUID == 1000 && $TERM == linux && ! $DISPLAY && $(tty) = /dev/tty1 && -x
     systemctl list-jobs
   fi
 fi
+_ran_bashrc=t
 
 #### if (in
 # noninteractive ssh shells or tty). tty because often i use it when
index ce4651bce82dd96a902b5db0b5bed3c04738cff7..7769e641828ad378a7e38bc40e30895c13470c9e 100644 (file)
--- a/btrbk-run
+++ b/btrbk-run
@@ -919,6 +919,7 @@ else
   done
 fi
 
+bzip2 $log_path
 # todo, we get hostnames earlier, reuse that.
 if [[ $ret == 0 ]]; then
   for tg in ${targets[@]}; do
@@ -926,12 +927,12 @@ if [[ $ret == 0 ]]; then
     if [[ $h == kd && $HOSTNAME == x3 && $HOSTNAME == "$MAIL_HOST" ]]; then
       d ssh root@$tg 'btrbk-spread-wrap &>/dev/null </dev/null &'
     fi
-    rsync --mkpath -a -f"- */" -f"+ *" /var/log/btrbk/ root@$tg:/var/log/btrbk/$tg
+    m rsync --mkpath -a -f"- */" -f"+ *" /var/log/btrbk/ root@$tg:/var/log/btrbk/$HOSTNAME
     cmd=/usr/local/bin/mail-backup-clean
     ssh root@$tg "if test -x $cmd; then $cmd; fi"
   done
   if [[ $source ]]; then
-    rsync --mkpath -a -f"- */" -f"+ *" $source:/var/log/btrbk/ /var/log/btrbk/$source
+    rsync --mkpath -a -f"- */" -f"+ *" $source:/var/log/btrbk/ /var/log/btrbk/$source
   fi
 fi