5 # Perform temporary directory cleaning so that long-lived systems
6 # don't end up with excessively old files there.
9 # If there is a global system configuration file, suck it in.
11 if [ -r /etc/defaults/periodic.conf ]
13 . /etc/defaults/periodic.conf
17 case "$daily_clean_tmps_enable" in
19 if [ -z "$daily_clean_tmps_days" ]
21 echo '$daily_clean_tmps_enable is set but' \
22 '$daily_clean_tmps_days is not'
26 echo "Removing old temporary files:"
29 args="-atime +$daily_clean_tmps_days -mtime +$daily_clean_tmps_days"
30 args="${args} -ctime +$daily_clean_tmps_days"
31 dargs="-empty -mtime +$daily_clean_tmps_days"
32 [ -n "$daily_clean_tmps_ignore" ] && {
33 args="$args "`echo " ${daily_clean_tmps_ignore% }" |
34 sed 's/[ ][ ]*/ ! -name /g'`
35 dargs="$dargs "`echo " ${daily_clean_tmps_ignore% }" |
36 sed 's/[ ][ ]*/ ! -name /g'`
38 case "$daily_clean_tmps_verbose" in
45 rc=$(for dir in $daily_clean_tmps_dirs
47 [ ."${dir#/}" != ."$dir" -a -d $dir ] && cd $dir && {
48 find -d . -type f $args -delete $print
49 find -d . ! -name . -type d $dargs -delete $print
50 } | sed "s,^\\., $dir,"
51 done | tee /dev/stderr | wc -l)
52 [ -z "$print" ] && rc=0