Home | History | Annotate | Line # | Download | only in etc
weekly revision 1.1
      1  1.1  cgd #!/bin/sh -
      2  1.1  cgd #
      3  1.1  cgd #	@(#)weekly	5.14 (Berkeley) 6/23/91
      4  1.1  cgd #
      5  1.1  cgd 
      6  1.1  cgd PATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/libexec
      7  1.1  cgd export PATH
      8  1.1  cgd 
      9  1.1  cgd host=`hostname -s`
     10  1.1  cgd echo "Subject: $host weekly run output"
     11  1.1  cgd 
     12  1.1  cgd #echo ""
     13  1.1  cgd #echo "Removing old .o files:"
     14  1.1  cgd #find /usr/src -name '*.o' -atime +21 -print -a -exec rm -f {} \;
     15  1.1  cgd 
     16  1.1  cgd # see if /usr/src exists and is local
     17  1.1  cgd # before looking there for checked-out files
     18  1.1  cgd 
     19  1.1  cgd if [ -d /usr/src -a \
     20  1.1  cgd   X"`find -f /usr/src ! -fstype local -prune -or -type d -print -prune`" != X ];
     21  1.1  cgd then
     22  1.1  cgd 	echo "looking for checked out files:"
     23  1.1  cgd 	TDIR=/tmp/_checkout$$
     24  1.1  cgd 
     25  1.1  cgd 	mkdir $TDIR
     26  1.1  cgd 	for file in `find -f /usr/src ! -fstype local -prune -or \
     27  1.1  cgd 	    -name 'p.*' -print | egrep 'SCCS/p\.'`; do
     28  1.1  cgd 		owner=`awk '{ print $3 }' $file`
     29  1.1  cgd 		echo "$owner	$file"
     30  1.1  cgd 		echo $file >> $TDIR/$owner
     31  1.1  cgd 	done | sed -e 's,SCCS/p.,,'
     32  1.1  cgd 	for file in $TDIR/*; do
     33  1.1  cgd 		sed -e 's,SCCS/p.,,' $file | \
     34  1.1  cgd 		    Mail -s 'checked out files' `basename $file`
     35  1.1  cgd 	done
     36  1.1  cgd 	rm -rf $TDIR
     37  1.1  cgd fi
     38  1.1  cgd 
     39  1.1  cgd if [ -f /usr/lib/uucp/clean.weekly ]; then
     40  1.1  cgd 	echo ""
     41  1.1  cgd 	echo "Cleaning up UUCP:"
     42  1.1  cgd 	echo /usr/lib/uucp/clean.weekly | su daemon
     43  1.1  cgd fi
     44  1.1  cgd echo ""
     45  1.1  cgd 
     46  1.1  cgd echo "Rotating messages:"
     47  1.1  cgd cd /var/log
     48  1.1  cgd if [ -f messages.2 ]; then mv -f messages.2 messages.3; fi
     49  1.1  cgd if [ -f messages.1 ]; then mv -f messages.1 messages.2; fi
     50  1.1  cgd if [ -f messages.0 ]; then mv -f messages.0 messages.1; fi
     51  1.1  cgd mv -f messages   messages.0
     52  1.1  cgd cp /dev/null  messages
     53  1.1  cgd chmod 644 messages
     54  1.1  cgd kill -1 `cat /var/run/syslog.pid`
     55  1.1  cgd cd /
     56  1.1  cgd 
     57  1.1  cgd echo ""
     58  1.1  cgd echo "Rebuilding locate database:"
     59  1.1  cgd echo /usr/libexec/locate.updatedb | nice -5 su -m nobody 2>/dev/null
     60