weekly revision 1.9
1#!/bin/sh - 2# 3# $NetBSD: weekly,v 1.9 1997/10/27 04:11:40 lukem Exp $ 4# from: @(#)weekly 8.2 (Berkeley) 1/2/94 5# 6 7PATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/libexec 8export PATH 9 10umask 077 11 12host=`hostname` 13echo "Subject: $host weekly run output" 14 15if [ -s /etc/weekly.conf ]; then 16 . /etc/weekly.conf 17fi 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# -n "`find -f /usr/src ! -fstype local -prune -or -type d -print -prune`" ]; 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 48if [ "$clean_uucp" = YES ] && [ -f /usr/libexec/uucp/clean.weekly ]; then 49 echo "" 50 echo "Cleaning up UUCP:" 51 su daemon -c /usr/libexec/uucp/clean.weekly 52fi 53echo "" 54 55echo "" 56if [ "$rebuild_locatedb" = YES ] && [ -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 nice -5 su -m nobody -c /usr/libexec/locate.updatedb 2>/dev/null 61 chown root.wheel /var/db/locate.database 62else 63 echo "Not rebuilding locate database; no /var/db/locate.database" 64fi 65