1 #!/bin/sh - 2 # 3 # $NetBSD: weekly,v 1.7 1997/02/15 10:02:29 mikel Exp $ 4 # from: @(#)weekly 8.2 (Berkeley) 1/2/94 5 # 6 7 PATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/libexec 8 export PATH 9 10 umask 077 11 12 host=`hostname` 13 echo "Subject: $host weekly run output" 14 15 if [ -s /etc/weekly.conf ]; then 16 . /etc/weekly.conf 17 fi 18 19 #echo "" 20 #echo "Removing old .o files:" 21 #find /usr/src -name '*.o' -atime +21 -print -a -exec rm -f {} \; 22 23 # see if /usr/src exists and is local 24 # before looking there for checked-out files 25 26 #if [ -d /usr/src -a \ 27 # X"`find -f /usr/src ! -fstype local -prune -or -type d -print -prune`" != X ]; 28 #then 29 # echo "looking for checked out files:" 30 # TDIR=/tmp/_checkout$$ 31 # 32 # mkdir $TDIR 33 # for file in `find -f /usr/src ! -fstype local -prune -or \ 34 # -name 'p.*' -print | egrep 'SCCS/p\.'`; do 35 # owner=`awk '{ print $3 }' $file` 36 # echo "$owner $file" 37 # echo $file >> $TDIR/$owner 38 # done | sed -e 's,SCCS/p.,,' 39 # if test -n "`ls $TDIR`"; then 40 # for file in $TDIR/*; do 41 # sed -e 's,SCCS/p.,,' $file | \ 42 # Mail -s 'checked out files' `basename $file` 43 # done 44 # fi 45 # rm -rf $TDIR 46 #fi 47 48 if [ X"$clean_uucp" != XNO -a -f /usr/lib/uucp/clean.weekly ]; then 49 echo "" 50 echo "Cleaning up UUCP:" 51 echo /usr/lib/uucp/clean.weekly | su daemon 52 fi 53 echo "" 54 55 echo "" 56 if [ X"$rebuild_locatedb" != XNO -a -f /var/db/locate.database ]; then 57 echo "Rebuilding locate database:" 58 chmod 644 /var/db/locate.database 59 chown nobody.nobody /var/db/locate.database 60 echo /usr/libexec/locate.updatedb | nice -5 su -m nobody 2>/dev/null 61 chown root.wheel /var/db/locate.database 62 else 63 echo "Not rebuilding locate database; no /var/db/locate.database" 64 fi 65