Commit | Line | Data |
---|---|---|
952b5ded KB |
1 | #!/bin/sh - |
2 | # | |
30c9bcef | 3 | # @(#)weekly 5.16 (Berkeley) %G% |
952b5ded | 4 | # |
f5a01a00 | 5 | |
edb1fd5f | 6 | PATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/libexec |
f5a01a00 KB |
7 | export PATH |
8 | ||
f408d08b | 9 | host=`hostname -s` |
952b5ded KB |
10 | echo "Subject: $host weekly run output" |
11 | ||
12 | #echo "" | |
13 | #echo "Removing old .o files:" | |
b223d76b | 14 | #find /usr/src -name '*.o' -atime +21 -print -a -exec rm -f {} \; |
952b5ded | 15 | |
052ef94c MK |
16 | # see if /usr/src exists and is local |
17 | # before looking there for checked-out files | |
18 | ||
19 | if [ -d /usr/src -a \ | |
3b0ae680 | 20 | X"`find -f /usr/src ! -fstype local -prune -or -type d -print -prune`" != X ]; |
052ef94c MK |
21 | then |
22 | echo "looking for checked out files:" | |
23 | TDIR=/tmp/_checkout$$ | |
24 | ||
25 | mkdir $TDIR | |
7146beda | 26 | for file in `find -f /usr/src ! -fstype local -prune -or \ |
b223d76b | 27 | -name 'p.*' -print | egrep 'SCCS/p\.'`; do |
052ef94c MK |
28 | owner=`awk '{ print $3 }' $file` |
29 | echo "$owner $file" | |
30 | echo $file >> $TDIR/$owner | |
30c9bcef | 31 | done | sed -e 's,SCCS/p.,,' | sort |
052ef94c MK |
32 | for file in $TDIR/*; do |
33 | sed -e 's,SCCS/p.,,' $file | \ | |
34 | Mail -s 'checked out files' `basename $file` | |
35 | done | |
36 | rm -rf $TDIR | |
37 | fi | |
f5a01a00 | 38 | |
952b5ded KB |
39 | if [ -f /usr/lib/uucp/clean.weekly ]; then |
40 | echo "" | |
41 | echo "Cleaning up UUCP:" | |
42 | echo /usr/lib/uucp/clean.weekly | su daemon | |
43 | fi | |
952b5ded | 44 | echo "" |
052ef94c | 45 | |
952b5ded | 46 | echo "Rotating messages:" |
f5a01a00 | 47 | cd /var/log |
952b5ded KB |
48 | if [ -f messages.2 ]; then mv -f messages.2 messages.3; fi |
49 | if [ -f messages.1 ]; then mv -f messages.1 messages.2; fi | |
50 | if [ -f messages.0 ]; then mv -f messages.0 messages.1; fi | |
51 | mv -f messages messages.0 | |
52 | cp /dev/null messages | |
53 | chmod 644 messages | |
28ffe2cf | 54 | kill -1 `cat /var/run/syslog.pid` |
952b5ded KB |
55 | cd / |
56 | ||
f5a01a00 | 57 | echo "" |
edb1fd5f | 58 | echo "Rebuilding locate database:" |
db944fce | 59 | echo /usr/libexec/locate.updatedb | nice -5 su -m nobody 2>/dev/null |