Various shell scripts for use on the RTC server. Not your official RTC stuff!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

24 lines
570 B

#! /bin/bash
# Services usage by date histogram
# Author: samhunter@rawtext.club
# https://git.rawtext.club/samhunter/rtc-shell-scripts
#
PROGNAME="${0##*/}"
VERSION="1.0"
recent++ \
| awk '
function hist(x,m){
return sprintf("%-20s\n", substr("####################",0,int(20*(x/max))))
}
{ a[$1]++
max=a[$1]>max?a[$1]:max
}
END{
for (d in a) {
printf("%10s %8i %-20.20s\n",d, a[d],hist(a[d],max))
}
}' \
| sort -r
# vim: ts=4 sw=4 expandtab :