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