Commit | Line | Data |
---|---|---|
952b5ded KB |
1 | #!/bin/sh - |
2 | # | |
b73d0dc0 | 3 | # @(#)weekly 8.2 (Berkeley) %G% |
952b5ded | 4 | # |
f5a01a00 | 5 | |
edb1fd5f | 6 | PATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/libexec |
f5a01a00 KB |
7 | export PATH |
8 | ||
32e3fbdd | 9 | host=`hostname` |
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 |
b73d0dc0 KB |
32 | if test -n "`ls $TDIR`"; then |
33 | for file in $TDIR/*; do | |
34 | sed -e 's,SCCS/p.,,' $file | \ | |
35 | Mail -s 'checked out files' `basename $file` | |
36 | done | |
37 | fi | |
052ef94c MK |
38 | rm -rf $TDIR |
39 | fi | |
f5a01a00 | 40 | |
952b5ded KB |
41 | if [ -f /usr/lib/uucp/clean.weekly ]; then |
42 | echo "" | |
43 | echo "Cleaning up UUCP:" | |
44 | echo /usr/lib/uucp/clean.weekly | su daemon | |
45 | fi | |
952b5ded | 46 | echo "" |
052ef94c | 47 | |
d2613fec KB |
48 | echo "" |
49 | echo -n "Rotating log files:" | |
f5a01a00 | 50 | cd /var/log |
d2613fec KB |
51 | for i in amd messages; do |
52 | echo -n " $i" | |
53 | if [ -f $i.5 ]; then mv -f $i.5 $i.6; fi | |
54 | if [ -f $i.4 ]; then mv -f $i.4 $i.5; fi | |
55 | if [ -f $i.3 ]; then mv -f $i.3 $i.4; fi | |
56 | if [ -f $i.2 ]; then mv -f $i.2 $i.3; fi | |
57 | if [ -f $i.1 ]; then mv -f $i.1 $i.2; fi | |
58 | if [ -f $i.0 ]; then mv -f $i.0 $i.1; fi | |
59 | if [ -f $i ]; then mv -f $i $i.0; fi | |
60 | >$i | |
61 | done | |
62 | echo "" | |
63 | ||
28ffe2cf | 64 | kill -1 `cat /var/run/syslog.pid` |
952b5ded KB |
65 | cd / |
66 | ||
f5a01a00 | 67 | echo "" |
edb1fd5f | 68 | echo "Rebuilding locate database:" |
db944fce | 69 | echo /usr/libexec/locate.updatedb | nice -5 su -m nobody 2>/dev/null |