131714Sbostic#!/bin/sh - 231714Sbostic# 3*40913Ssklower# @(#)weekly 5.7 (Berkeley) 04/12/90 431714Sbostic# 537438Sbostic 6*40913SsklowerPATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/libexec 737438Sbosticexport PATH 837438Sbostic 931714Sbostichost=`hostname | sed -e 's/\..*//'` 1031714Sbosticecho "Subject: $host weekly run output" 1131714Sbostic 1231714Sbostic#echo "" 1331714Sbostic#echo "Removing old .o files:" 1431714Sbostic#find /usr/src -name '*.o' -atime +21 -print -a -exec rm -f {} \; 1531714Sbostic 1637438Sbosticecho "looking for checked out files:" 1737438SbosticTDIR=/tmp/_checkout$$ 1837438Sbostic 1937438Sbosticmkdir $TDIR 2037438Sbosticfor file in `find /usr/src -name 'p.*' -print | egrep 'SCCS/p\.'`; do 2137438Sbostic owner=`awk '{ print $3 }' $file` 2237438Sbostic echo "$owner $file" 2337438Sbostic echo $file >> $TDIR/$owner 2437438Sbosticdone | sed -e 's,SCCS/p.,,' 2537438Sbosticfor file in $TDIR/*; do 2637438Sbostic sed -e 's,SCCS/p.,,' $file | \ 2737438Sbostic Mail -s 'checked out files' `basename $file` 2837438Sbosticdone 2937438Sbosticrm -rf $TDIR 3037438Sbostic 3131714Sbosticif [ -f /usr/lib/uucp/clean.weekly ]; then 3231714Sbostic echo "" 3331714Sbostic echo "Cleaning up UUCP:" 3431714Sbostic echo /usr/lib/uucp/clean.weekly | su daemon 3531714Sbosticfi 3631714Sbostic 3731714Sbosticecho "" 3831714Sbosticecho "Rotating messages:" 3937438Sbosticcd /var/log 4031714Sbosticif [ -f messages.2 ]; then mv -f messages.2 messages.3; fi 4131714Sbosticif [ -f messages.1 ]; then mv -f messages.1 messages.2; fi 4231714Sbosticif [ -f messages.0 ]; then mv -f messages.0 messages.1; fi 4331714Sbosticmv -f messages messages.0 4431714Sbosticcp /dev/null messages 4531714Sbosticchmod 644 messages 4639125Sbostickill -1 `cat /var/run/syslog.pid` 4731714Sbosticcd / 4831714Sbostic 4937438Sbosticecho "" 50*40913Ssklowerecho "Rebuilding locate database:" 51*40913Ssklowerecho locate.updatedb | nice -5 su -m nobody 2>/dev/null 52