X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=system-status;h=b8e854dbff25b158575aaa99eaadbb21eb734690;hb=386ec3bb9a0a35be10431d3da9fa21a1d9bc29e2;hp=25a637ee9606788c97e22949b470a811428abf16;hpb=7e4f3d0a6130b69b7f76a3ff13e510ffbeb1484b;p=distro-setup diff --git a/system-status b/system-status index 25a637e..b8e854d 100755 --- a/system-status +++ b/system-status @@ -35,6 +35,10 @@ write-status() { chars+=("MAILPING!") fi + qlen=$(/usr/sbin/exim -bpc) + if ((qlen)); then + chars+=("q $qlen") + fi if ! make -q ~/.local/distro-begin || [[ $(<~/.local/distro-begin) != 0 ]]; then chars+=("DISTRO-BEGIN!") @@ -100,7 +104,13 @@ write-status() { ## check if last snapshot was within an hour vol=o - snaps=(/mnt/root/btrbk/$vol.20*) + # this section generally copied from btrbk scripts, but + # this part modified to speed things up by about half a second. + # I'm not sure if its quite as reliable, but it looks pretty safe. + # Profiled it using time and also adding to the top of the file: + # set -x + # PS4='+ $(date "+%2N") ' + snaps=($(ls -1avdr /mnt/root/btrbk/$vol.20*|head -n1)) now=$(date +%s) maxtime=0 for s in ${snaps[@]}; do