weekly revision 1.1
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.1Scgdif [ -d /usr/src -a \
201.1Scgd  X"`find -f /usr/src ! -fstype local -prune -or -type d -print -prune`" != X ];
211.1Scgdthen
221.1Scgd	echo "looking for checked out files:"
231.1Scgd	TDIR=/tmp/_checkout$$
241.1Scgd
251.1Scgd	mkdir $TDIR
261.1Scgd	for file in `find -f /usr/src ! -fstype local -prune -or \
271.1Scgd	    -name 'p.*' -print | egrep 'SCCS/p\.'`; do
281.1Scgd		owner=`awk '{ print $3 }' $file`
291.1Scgd		echo "$owner	$file"
301.1Scgd		echo $file >> $TDIR/$owner
311.1Scgd	done | sed -e 's,SCCS/p.,,'
321.1Scgd	for file in $TDIR/*; do
331.1Scgd		sed -e 's,SCCS/p.,,' $file | \
341.1Scgd		    Mail -s 'checked out files' `basename $file`
351.1Scgd	done
361.1Scgd	rm -rf $TDIR
371.1Scgdfi
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.1Scgdecho "Rotating messages:"
471.1Scgdcd /var/log
481.1Scgdif [ -f messages.2 ]; then mv -f messages.2 messages.3; fi
491.1Scgdif [ -f messages.1 ]; then mv -f messages.1 messages.2; fi
501.1Scgdif [ -f messages.0 ]; then mv -f messages.0 messages.1; fi
511.1Scgdmv -f messages   messages.0
521.1Scgdcp /dev/null  messages
531.1Scgdchmod 644 messages
541.1Scgdkill -1 `cat /var/run/syslog.pid`
551.1Scgdcd /
561.1Scgd
571.1Scgdecho ""
581.1Scgdecho "Rebuilding locate database:"
591.1Scgdecho /usr/libexec/locate.updatedb | nice -5 su -m nobody 2>/dev/null
60