Annotation of src/etc/weekly, Revision 1.5
1.1 deraadt 1: #!/bin/sh -
2: #
1.5 ! millert 3: # $OpenBSD: weekly,v 1.4 1996/12/18 04:32:57 millert Exp $
1.1 deraadt 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:
1.2 david 12: if [ -f /etc/weekly.local ];then
13: echo ""
14: echo "Running weekly.local:"
15: . /etc/weekly.local
16: fi
17:
1.1 deraadt 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: #
1.4 millert 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
1.1 deraadt 47: #fi
48:
49: if [ -f /usr/lib/uucp/clean.weekly ]; then
50: echo ""
51: echo "Cleaning up UUCP:"
52: echo /usr/lib/uucp/clean.weekly | su daemon
53: fi
54: echo ""
55:
56: # Rotation of message log now handled automatically by cron and 'newsyslog'
57:
58: echo ""
59: if [ -f /var/db/locate.database ]; then
60: echo "Rebuilding locate database:"
61: chmod 644 /var/db/locate.database
1.5 ! millert 62: chown bin /var/db/locate.database
! 63: echo /usr/libexec/locate.updatedb | nice -5 su -m bin 2>/dev/null
1.1 deraadt 64: chown root.wheel /var/db/locate.database
65: else
66: echo "Not rebuilding locate database; no /var/db/locate.database"
67: fi