#!/bin/sh # /etc/cron.daily/webalizer: webalizer daily maintenance script # Written by Remco van de Meent . # changed by toni to deal with multiple sites. # we're using webalizer compiled from debian source package # with --enable-dns option. source is in /usr/local/src/ WEBALIZER_BIN=/usr/local/bin/webalizer WEBALIZER_DIR=/etc/webalizer WEBAZOLVER_BIN=/usr/local/bin/webazolver WEBAZOLVER_DNS=/var/lib/webalizer/dns_cache.db WEBAZOLVER_VHOSTS=/www/webalizer-vhosts CHILDREN=20 # See if the webalizer binary and config file exists # if not, exit without warning to prevent daily mails [ -f ${WEBALIZER_BIN} ] || exit 0 [ -d ${WEBALIZER_DIR} ] || exit 0 [ -f ${WEBAZOLVER_BIN} ] || exit 0 [ -d ${WEBAZOLVER_VHOSTS} ] || exit 0 for i in ${WEBAZOLVER_VHOSTS}/*; do VHOST=`basename $i` webazolver -N $CHILDREN -D $WEBAZOLVER_DNS /www/$VHOST/logs/access.log done # to make sure all DNS resolving child processes finish sleep 5; for i in ${WEBALIZER_DIR}/*.conf; do ${WEBALIZER_BIN} -q -c $i -D $WEBAZOLVER_DNS; done # Exit with webalizer's exit code exit $?