weekly revision 1.3
11.1Scgd#!/bin/sh -
21.1Scgd#
31.1Scgd#	@(#)weekly	5.14 (Berkeley) 6/23/91
41.1Scgd#
51.1Scgd
61.1ScgdPATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/libexec
71.1Scgdexport PATH
81.1Scgd
91.1Scgdhost=`hostname -s`
101.1Scgdecho "Subject: $host weekly run output"
111.1Scgd
121.1Scgd#echo ""
131.1Scgd#echo "Removing old .o files:"
141.1Scgd#find /usr/src -name '*.o' -atime +21 -print -a -exec rm -f {} \;
151.1Scgd
161.1Scgd# see if /usr/src exists and is local
171.1Scgd# before looking there for checked-out files
181.1Scgd
191.2Scgd#if [ -d /usr/src -a \
201.2Scgd#  X"`find -f /usr/src ! -fstype local -prune -or -type d -print -prune`" != X ];
211.2Scgd#then
221.2Scgd#	echo "looking for checked out files:"
231.2Scgd#	TDIR=/tmp/_checkout$$
241.2Scgd#
251.2Scgd#	mkdir $TDIR
261.2Scgd#	for file in `find -f /usr/src ! -fstype local -prune -or \
271.2Scgd#	    -name 'p.*' -print | egrep 'SCCS/p\.'`; do
281.2Scgd#		owner=`awk '{ print $3 }' $file`
291.2Scgd#		echo "$owner	$file"
301.2Scgd#		echo $file >> $TDIR/$owner
311.2Scgd#	done | sed -e 's,SCCS/p.,,'
321.2Scgd#	for file in $TDIR/*; do
331.2Scgd#		sed -e 's,SCCS/p.,,' $file | \
341.2Scgd#		    Mail -s 'checked out files' `basename $file`
351.2Scgd#	done
361.2Scgd#	rm -rf $TDIR
371.2Scgd#fi
381.1Scgd
391.1Scgdif [ -f /usr/lib/uucp/clean.weekly ]; then
401.1Scgd	echo ""
411.1Scgd	echo "Cleaning up UUCP:"
421.1Scgd	echo /usr/lib/uucp/clean.weekly | su daemon
431.1Scgdfi
441.1Scgdecho ""
451.1Scgd
461.3Scgd# Rotation of message log now handled automatically by cron and 'newsyslog'
471.1Scgd
481.1Scgdecho ""
491.1Scgdecho "Rebuilding locate database:"
501.1Scgdecho /usr/libexec/locate.updatedb | nice -5 su -m nobody 2>/dev/null
51