#!/bin/sh

BINDIR=/usr/bin
SPOOLDIR=/var/spool/uucp
SAVELOG=/usr/lib/smail/savelog

# Warnung, falls aelter als zwei Tage
${BINDIR}/uustat -c rmail -o 48 -N -Q \
-W"Unable to deliver; will try up to one week."

# Zurueck, falls aelter als eine Woche
${BINDIR}/uustat -c rmail -o 168 -K -M -N -Q \
-W"Could not be delivered for more than one week."

# Alles andere weg, falls aelter als eine Woche
${BINDIR}/uustat -o 168 -K -M -N -Q -W"More than one week old."

# Execs weg, die aelter als rei Tage sind:
${BINDIR}/uustat -o 72 -M -N -Q -W"Unable to execute for three days."

# Dateien weg, die aelter sind als 8 Tage
find ${SPOOLDIR} -ctime +8 -name '[CDX].*' -print -exec /bin/rm -f \{\} \;

# Zwischendateien nach einem Tag weg
find ${SPOOLDIR} -atime +1 -ctime +1 -name 'TM.*' \
-print -exec /bin/rm -f \{\} \;

# Logbuecher kuerzen:
for i in `uuname`
do
  $SAVELOG -t -c 3 $SPOOLDIR/.Log/uucico/$i
  $SAVELOG -t -c 3 $SPOOLDIR/.Log/uuxqt/$i
  $SAVELOG -t -c 3 $SPOOLDIR/.Log/uux/$i
  $SAVELOG -t -c 3 $SPOOLDIR/.Log/uucp/$i
done



