freebsd-dev/etc/periodic/daily/110.clean-tmps
Joerg Wunsch 0e20a72001 Finally remove the ancient `-exec rm -f {} ;' cruft that used to be
used to cleanup old files, and replace it by -delete which has been
present in our find(1) for ages now.
1999-03-21 12:34:06 +00:00

26 lines
646 B
Bash
Executable File

#!/bin/sh
#
# $Id: 110.clean-tmps,v 1.3 1997/09/11 15:21:30 ache Exp $
#
# Use at your own risk, but for a long-living system, this might come
# more useful than the boot-time cleaning of /tmp. If /var/tmp and
# /tmp are symlinked together, only one of the below will actually
# run.
#
exit 0 # do not run by default
if [ -d /tmp ]; then
cd /tmp && {
find . -type f -atime +3 -ctime +3 ! -name '.X*-lock' -delete
find -d . ! -name . -type d -mtime +1 -delete
}
fi
if [ -d /var/tmp ]; then
cd /var/tmp && {
find . ! -name . -atime +7 -ctime +3 -delete
find -d . ! -name . ! -name vi.recover -type d -mtime +1 -delete
}
fi