#!/bin/sh
#
# This housekeeping shell script is installed as /etc/cron.daily/wwwoffle.
# Cron automatically runs it once a day.
#
# This script simply runs 'wwwoffle -purge' to purge the cache and 
# discard the output. If you want to save the output, simply
# choose a name for the log file. If the log file exists, it is
# rotated every day.

WWWOFFLE_CACHE_LOG=

if test x$WWWOFFLE_CACHE_LOG = x ; then
    wwwoffle -purge >/dev/null 2>/dev/null
else
    if [ -f /var/log/$WWWOFFLE_CACHE_LOG ]; then
	savelog -g adm -m 644 -u root -c 4 \
	    /var/log/$WWWOFFLE_CACHE_LOG >/dev/null 
    fi
    wwwoffle -purge >/var/log/$WWWOFFLE_CACHE_LOG \
	2>/var/log/$WWWOFFLE_CACHE_LOG
fi
