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
systemctl list-jobs
fi
fi
+_ran_bashrc=t
#### if (in
# noninteractive ssh shells or tty). tty because often i use it when
done
fi
+bzip2 $log_path
# todo, we get hostnames earlier, reuse that.
if [[ $ret == 0 ]]; then
for tg in ${targets[@]}; do
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
+ m rsync --mkpath -a -f"- */" -f"+ *" $source:/var/log/btrbk/ /var/log/btrbk/$source
fi
fi