Use $clear_daily_* from rc.conf to decide what should be deleted

Reviewed by:	The silence of -committers
This commit is contained in:
brian 2000-06-09 17:05:11 +00:00
parent 1c8d742b13
commit ceb9d96a6e

View File

@ -17,29 +17,33 @@ elif [ -r /etc/rc.conf ]; then
. /etc/rc.conf . /etc/rc.conf
fi fi
case "$clear_tmp_enable" in case "$clear_daily_enable" in
[Yy][Ee][Ss]) [Yy][Ee][Ss])
echo "" if [ -n "$clear_daily_days" ]
echo "Removing old temporary files:" then
echo ""
echo "Removing old temporary files:"
[ -d /tmp ] && cd /tmp && { set -f noglob
find -d . -type f -atime +3 -ctime +3 ! -name '.X*-lock' \ args="-atime +$clear_daily_days -mtime +$clear_daily_days"
! -name quota.user ! -name quota.group -delete [ -n "$clear_daily_ignore" ] &&
find -d . ! -name . -type d -mtime +1 -delete args="$args "`echo " ${clear_daily_ignore% }" |
} sed 's/[ ][ ]*/ ! -name /g'`
case "$clear_daily_verbose" in
[Yy][Ee][Ss])
print=-print;;
*)
print=;;
esac
[ -d /var/tmp ] && cd /var/tmp && { for dir in $clear_daily_dirs
find -d . ! -name . -atime +7 -ctime +3 \ do
! -name quota.user ! -name quota.group -delete [ ."${dir#/}" != ."$dir" -a -d $dir ] && cd $dir && {
find -d . ! -name . ! -name vi.recover -type d -mtime +1 -delete find -d . -type f $args -delete $print
} find -d . ! -name . -type d -mtime +$clear_daily_days \
-delete $print
case "$linux_enable" in } | sed "s,^\\., $dir,"
[Yy][Ee][Ss]) done
[ -d /compat/linux/tmp ] && cd /compat/linux/tmp && { set -f glob
find -d . ! -name . -atime +7 -ctime +3 \ fi;;
! -name quota.user ! -name quota.group -delete
find -d . ! -name . -type d -mtime +1 -delete
};;
esac
esac esac