weekly revision 1.2
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.2Scgd#if [ -d /usr/src -a \ 201.2Scgd# X"`find -f /usr/src ! -fstype local -prune -or -type d -print -prune`" != X ]; 211.2Scgd#then 221.2Scgd# echo "looking for checked out files:" 231.2Scgd# TDIR=/tmp/_checkout$$ 241.2Scgd# 251.2Scgd# mkdir $TDIR 261.2Scgd# for file in `find -f /usr/src ! -fstype local -prune -or \ 271.2Scgd# -name 'p.*' -print | egrep 'SCCS/p\.'`; do 281.2Scgd# owner=`awk '{ print $3 }' $file` 291.2Scgd# echo "$owner $file" 301.2Scgd# echo $file >> $TDIR/$owner 311.2Scgd# done | sed -e 's,SCCS/p.,,' 321.2Scgd# for file in $TDIR/*; do 331.2Scgd# sed -e 's,SCCS/p.,,' $file | \ 341.2Scgd# Mail -s 'checked out files' `basename $file` 351.2Scgd# done 361.2Scgd# rm -rf $TDIR 371.2Scgd#fi 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.2Scgdif [ -f messages.2.Z ]; then mv -f messages.2.Z messages.3.Z; fi 491.2Scgdif [ -f messages.1.Z ]; then mv -f messages.1.Z messages.2.Z; fi 501.2Scgdif [ -f messages.0.Z ]; then mv -f messages.0.Z messages.1.Z; fi 511.2Scgdmv -f messages messages.0 521.2Scgdcompress -f messages.0 531.2Scgdcp /dev/null messages 541.1Scgdchmod 644 messages 551.1Scgdkill -1 `cat /var/run/syslog.pid` 561.1Scgdcd / 571.1Scgd 581.1Scgdecho "" 591.1Scgdecho "Rebuilding locate database:" 601.1Scgdecho /usr/libexec/locate.updatedb | nice -5 su -m nobody 2>/dev/null 61