codekasten/spielspass/logkosmetik-server.sh

27 lines
831 B
Bash
Raw Normal View History

2006-01-08 18:42:26 +01:00
#!/bin/bash
set -u
#DATE=`date '+%Y-%m'`
DATE=`date -d '1 month ago' '+%Y-%m'`
SRC="/var/log/apache/access-${DATE}.log"
DST_SAO="/tmp/access-${DATE}_sao.log.shrunk"
DST_SOBI="/tmp/access-${DATE}_sobi.log.shrunk"
nice -n 10 cat ${SRC} | grep "webproxy pound" | grep "systemausfall.org" > ${DST_SAO}
[ -e ${DST_SAO}.gz ] && rm ${DST_SAO}.gz
gzip ${DST_SAO}
nice -n 10 cat ${SRC} | grep "webproxy pound" | grep "soziale-bildung.org" > ${DST_SAO}
[ -e ${DST_SAO}.gz ] && rm ${DST_SAO}.gz
gzip ${DST_SAO}
## we have no mailservice at all
#MAILBODY="scp uml-webproxy@systemausfall.org:/var/log/access.log.now.gz . && \n gunzip access.log.now && \n visitors -A -m 30 access.log.now --prefix systemausfall.org -o html > report-${DATE}.html"
#echo $MAILBODY > /tmp/foo
#mutt -n -F /dev/null -s "access.log" age < /tmp/foo
#rm $SRC