#!/bin/sh
# set -x
#
#	This script is used to keep the FTP Transfer area (/tmp/ftp)
#	trimmed down to size.  All files older than the last run of
#	this script will be removed.  This assures that the resources are used 
#	for transfer and not for general storage.
#
TRANSFER_DIR=/tmp/ftp
DATEFILE=${TRANSFER_DIR}/.clean
SETDATE=/usr/local/etc/setdate

HOURS_ONLINE=6
#
# Create a tempfile
#
rm ${DATEFILE}
> ${DATEFILE}
#
# Set the time back $HOURS_ONLINE
#
${SETDATE} -h ${HOURS_ONLINE} ${DATEFILE}

find ${TRANSFER_DIR} ! -newer ${DATEFILE} -type f -print |
	grep -v ${TRANSFER_DIR}/.rhosts |
	grep -v ${TRANSFER_DIR}/.hushlogin |
	grep -v ${TRANSFER_DIR}/.clean | xargs rm 

