#!/bin/sh
#
# Various weekly doable system checkups/log file cuts/..
# This MUST be run by ROOT, and a bit before system_daily
# executes at 24:00 !
#
PATH=/usr/bin:/bin:/usr/local/bin:/usr/local/gnu/bin

# Zmailer logs!
cd /var/log
for x in router scheduler smtp smtpserver usenet
do
	# cut, and compress..
	for y in oooo ooo oo o
	do
		if [ -f $x.$y.gz ]; then
			/bin/mv $x.$y.gz $x.${y}o.gz
		fi
	done
	/bin/mv $x $x.o
	/bin/touch $x
done
/etc/zmailer kill >/dev/null 2>&1
sleep 10
/etc/zmailer >/dev/null 2>&1

# do whatever is needed done quickly

# Final processings which have time..
cd /var/log
/usr/local/bin/gzip -9 *.o
