1997-08-16 17:04:02 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
1999-08-27 23:37:10 +00:00
|
|
|
# $FreeBSD$
|
1997-08-16 17:04:02 +00:00
|
|
|
#
|
2000-06-08 08:48:15 +00:00
|
|
|
# Perform temporary directory cleaning so that long-lived systems
|
|
|
|
# don't end up with excessively old files there. If /var/tmp and
|
1997-08-16 17:04:02 +00:00
|
|
|
# /tmp are symlinked together, only one of the below will actually
|
|
|
|
# run.
|
|
|
|
#
|
|
|
|
|
2000-06-08 08:48:15 +00:00
|
|
|
# If there is a global system configuration file, suck it in.
|
|
|
|
#
|
|
|
|
if [ -r /etc/defaults/rc.conf ]; then
|
|
|
|
. /etc/defaults/rc.conf
|
|
|
|
source_rc_confs
|
|
|
|
elif [ -r /etc/rc.conf ]; then
|
|
|
|
. /etc/rc.conf
|
1997-08-16 17:04:02 +00:00
|
|
|
fi
|
|
|
|
|
2000-06-08 08:48:15 +00:00
|
|
|
case "$clear_tmp_enable" in
|
|
|
|
[Yy][Ee][Ss])
|
|
|
|
echo ""
|
|
|
|
echo "Removing old temporary files:"
|
|
|
|
|
|
|
|
[ -d /tmp ] && cd /tmp && {
|
|
|
|
find -d . -type f -atime +3 -ctime +3 ! -name '.X*-lock' \
|
|
|
|
! -name quota.user ! -name quota.group -delete
|
|
|
|
find -d . ! -name . -type d -mtime +1 -delete
|
|
|
|
}
|
|
|
|
|
|
|
|
[ -d /var/tmp ] && cd /var/tmp && {
|
|
|
|
find -d . ! -name . -atime +7 -ctime +3 \
|
|
|
|
! -name quota.user ! -name quota.group -delete
|
|
|
|
find -d . ! -name . ! -name vi.recover -type d -mtime +1 -delete
|
|
|
|
}
|
|
|
|
|
|
|
|
case "$linux_enable" in
|
|
|
|
[Yy][Ee][Ss])
|
|
|
|
[ -d /compat/linux/tmp ] && cd /compat/linux/tmp && {
|
|
|
|
find -d . ! -name . -atime +7 -ctime +3 \
|
|
|
|
! -name quota.user ! -name quota.group -delete
|
|
|
|
find -d . ! -name . -type d -mtime +1 -delete
|
|
|
|
};;
|
|
|
|
esac
|
|
|
|
esac
|