#!/bin/bash
archivedir=/parablu/archive/tomcat-pcb1
logdir=/parablu/log/tomcat-pcb1
numfiles=5

gzip /parablu/log/tomcat-pcb1/*.log.*
echo "running tomcat-pcb1 archival script"
if [ ! -d "$archivedir" ];
then
        mkdir -p $archivedir 2>&1
fi

cd $logdir
mv *.gz $archivedir

sleep 2
cd $archivedir
ls -t | find . -mtime +3 | xargs -d '\n' rm
