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