#! /bin/bash
#
# PURPOSE: Copy logs from the dorado1 directory to ~rob/logs.
#

. .profile
cd logs
if [ -a "$1" ] 
then
    cd $1
else
    mkdir $1
    cd $1
fi

for file in $AUVD/logs/$1/*.log 
do
    gzip -c $file > `basename $file`.gz
    echo `basename $file`.gz
    touch -r $file `basename $file`.gz
done

for file in $AUVD/logs/$1/*.pp 
do
    gzip -c $file > `basename $file`.gz
    echo `basename $file`.gz
    touch -r $file `basename $file`.gz
done


for file in $AUVD/logs/$1/*.cfg 
do
    gzip -c $file > `basename $file`.gz
    touch -r $file `basename $file`.gz
done

gzip -c $AUVD/logs/$1/syslog > syslog.gz
touch -r $AUVD/logs/$1/syslog syslog.gz 

cd ~
