#!/bin/sh
#
# Cleaning up in the log directory. Keeps four versions of the log online.
# TNX to VK1KCM for this.
#
# DL6RAI, Wed Sep 30 21:50:37 GMT 1998

PID=`ps ax | grep syslog | grep -v grep | awk '{print $1}'`

cd ~clx_us/log
for i in *.log
do
	rm $i.4.gz
	mv $i.3.gz $i.4.gz
	mv $i.2.gz $i.3.gz
	mv $i.1.gz $i.2.gz
	mv $i $i.1
	gzip -f $i.1
	touch $i
	chown clx_us:users $i
done

kill -1 $PID
