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

gzip /parablu/log/tomcat-job1/*.log.*
echo "running tomcat-job1 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
