26 lines
831 B
Bash
Executable file
26 lines
831 B
Bash
Executable file
#!/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
|
|
|
|
|
|
|