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.2 cgd #if [ -d /usr/src -a \ 20 1.2 cgd # X"`find -f /usr/src ! -fstype local -prune -or -type d -print -prune`" != X ]; 21 1.2 cgd #then 22 1.2 cgd # echo "looking for checked out files:" 23 1.2 cgd # TDIR=/tmp/_checkout$$ 24 1.2 cgd # 25 1.2 cgd # mkdir $TDIR 26 1.2 cgd # for file in `find -f /usr/src ! -fstype local -prune -or \ 27 1.2 cgd # -name 'p.*' -print | egrep 'SCCS/p\.'`; do 28 1.2 cgd # owner=`awk '{ print $3 }' $file` 29 1.2 cgd # echo "$owner $file" 30 1.2 cgd # echo $file >> $TDIR/$owner 31 1.2 cgd # done | sed -e 's,SCCS/p.,,' 32 1.2 cgd # for file in $TDIR/*; do 33 1.2 cgd # sed -e 's,SCCS/p.,,' $file | \ 34 1.2 cgd # Mail -s 'checked out files' `basename $file` 35 1.2 cgd # done 36 1.2 cgd # rm -rf $TDIR 37 1.2 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.2 cgd if [ -f messages.2.Z ]; then mv -f messages.2.Z messages.3.Z; fi 49 1.2 cgd if [ -f messages.1.Z ]; then mv -f messages.1.Z messages.2.Z; fi 50 1.2 cgd if [ -f messages.0.Z ]; then mv -f messages.0.Z messages.1.Z; fi 51 1.2 cgd mv -f messages messages.0 52 1.2 cgd compress -f messages.0 53 1.2 cgd cp /dev/null messages 54 1.1 cgd chmod 644 messages 55 1.1 cgd kill -1 `cat /var/run/syslog.pid` 56 1.1 cgd cd / 57 1.1 cgd 58 1.1 cgd echo "" 59 1.1 cgd echo "Rebuilding locate database:" 60 1.1 cgd echo /usr/libexec/locate.updatedb | nice -5 su -m nobody 2>/dev/null 61