#!/bin/sh # Update-Logs v1.0 (c) 19.8.94 by Andreas Ley (u) 19.8.94 # Cycles the logfiles exec >/tmp/update-log.log 2>&1; set -x LOGS="access_log error_log" RZDailyPage=/Uni/RZ/Betrieb/Statistik/Daily.html suffix=`date +%Y%m%d` cd ${ServerRoot}/logs dirs=`ls -l | awk '/^d/{print$9}'` for dir in ${dirs}; do cd ${ServerRoot}/logs/${dir} cycle -c 1 ${LOGS} done cd ${ServerRoot}/logs rrun kill -USR1 `cat httpd.pid` # RZ Log analysis rzlog `date +%d.%m.%Y` Uni/access_log.1 > ${DocumentRoot}/${RZDailyPage} for dir in ${dirs}; do cd ${ServerRoot}/logs/${dir} test -d Old || mkdir Old for log in ${LOGS}; do ln ${log} Old/${log}.${suffix} # Don't do this! Gracefully restarted clients may still write # to the old logs for some ten or twenty minutes. # rm ${log}.[0-9] done find Old -type f -links 1 ! -name \*.gz -print | xargs gzip -9 done exit 0