#!/bin/sh

CHRDIR=/chroot/javad
CHRBIN=/usr/sbin/chroot

NAME=tomcat7
DEFAULT=$CHRDIR/etc/default/$NAME

# The following variables can be overwritten in $DEFAULT

# Default for number of days to keep old log files in /var/log/tomcatN/
LOGFILE_DAYS=14

# End of variables that can be overwritten in $DEFAULT

# overwrite settings from default file
if [ -f "$DEFAULT" ]; then
	. "$DEFAULT"
fi

if [ -d $CHRDIR/var/log/$NAME ]; then
	find $CHRDIR/var/log/$NAME/ -name \*.log -mtime +$LOGFILE_DAYS -print0 \
		| xargs --no-run-if-empty -0 rm --
fi
