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