head	1.21;
access;
symbols
	RELENG_2_2_8_RELEASE:1.17.2.2
	RELENG_2_2_7_RELEASE:1.17.2.2
	RELENG_2_2_6_RELEASE:1.17.2.2
	RELENG_2_2_5_RELEASE:1.17.2.1
	RELENG_2_2_2_RELEASE:1.17.2.1
	RELENG_2_2_1_RELEASE:1.17.2.1
	RELENG_2_2_0_RELEASE:1.17.2.1
	RELENG_2_1_7_RELEASE:1.10.4.3
	RELENG_2_1_6_1_RELEASE:1.10.4.3
	RELENG_2_1_6_RELEASE:1.10.4.3
	RELENG_2_2:1.17.0.2
	RELENG_2_2_BP:1.17
	RELENG_2_1_5_RELEASE:1.10.4.3
	RELENG_2_1_0_RELEASE:1.10
	RELENG_2_1_0:1.10.0.4
	RELENG_2_1_0_BP:1.10
	RELENG_2_0_5_RELEASE:1.10
	RELENG_2_0_5:1.10.0.2
	RELENG_2_0_5_BP:1.10
	RELENG_2_0_5_ALPHA:1.10
	RELEASE_2_0:1.6
	BETA_2_0:1.6
	ALPHA_2_0:1.6.0.2
	MOVED_NEWCVS:1.4
	FINAL_1_1_5:1.4
	ALPHA_1_1_5:1.4
	FINAL_1_1:1.4
	GAMMA_1_1:1.4
	BETA_1_1:1.4.0.2
	BP_BETA_1_1:1.4
	FINAL_1_0:1.4
	EPSILON_1_0:1.4
	GAMMA_1_0:1.4
	BETA_1_0:1.2
	ALPHA_1_0:1.1.1.1
	V_0_0_1_0:1.1.1.1;
locks; strict;
comment	@# @;


1.21
date	97.08.13.06.12.05;	author pst;	state dead;
branches;
next	1.20;

1.20
date	97.02.25.02.56.13;	author mpp;	state Exp;
branches;
next	1.19;

1.19
date	97.02.23.09.20.55;	author peter;	state Exp;
branches;
next	1.18;

1.18
date	97.01.14.05.44.44;	author jkh;	state Exp;
branches;
next	1.17;

1.17
date	96.10.19.21.52.12;	author alex;	state Exp;
branches
	1.17.2.1;
next	1.16;

1.16
date	96.05.18.20.30.04;	author nate;	state Exp;
branches;
next	1.15;

1.15
date	96.05.13.22.05.10;	author wosch;	state Exp;
branches;
next	1.14;

1.14
date	96.05.12.21.10.34;	author wosch;	state Exp;
branches;
next	1.13;

1.13
date	96.01.05.10.09.13;	author graichen;	state Exp;
branches;
next	1.12;

1.12
date	95.09.30.17.50.32;	author ache;	state Exp;
branches;
next	1.11;

1.11
date	95.07.17.19.36.17;	author mpp;	state Exp;
branches;
next	1.10;

1.10
date	95.04.09.09.54.45;	author rgrimes;	state Exp;
branches
	1.10.4.1;
next	1.9;

1.9
date	95.03.19.10.10.42;	author joerg;	state Exp;
branches;
next	1.8;

1.8
date	95.03.15.22.58.19;	author joerg;	state Exp;
branches;
next	1.7;

1.7
date	95.02.16.10.51.53;	author joerg;	state Exp;
branches;
next	1.6;

1.6
date	94.10.30.18.20.58;	author joerg;	state Exp;
branches;
next	1.5;

1.5
date	94.08.11.17.23.29;	author guido;	state Exp;
branches;
next	1.4;

1.4
date	93.08.31.16.29.05;	author rgrimes;	state Exp;
branches;
next	1.3;

1.3
date	93.08.10.11.35.46;	author rgrimes;	state Exp;
branches;
next	1.2;

1.2
date	93.08.09.15.18.02;	author rgrimes;	state Exp;
branches;
next	1.1;

1.1
date	93.06.20.13.41.38;	author rgrimes;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	93.06.20.13.41.39;	author rgrimes;	state Exp;
branches;
next	;

1.10.4.1
date	96.05.18.20.33.19;	author nate;	state Exp;
branches;
next	1.10.4.2;

1.10.4.2
date	96.05.29.22.23.50;	author jkh;	state Exp;
branches;
next	1.10.4.3;

1.10.4.3
date	96.06.05.02.36.41;	author jkh;	state Exp;
branches;
next	;

1.17.2.1
date	97.02.25.17.52.00;	author adam;	state Exp;
branches;
next	1.17.2.2;

1.17.2.2
date	98.01.10.00.06.55;	author steve;	state Exp;
branches;
next	1.17.2.3;

1.17.2.3
date	99.01.01.17.44.15;	author billf;	state Exp;
branches;
next	1.17.2.4;

1.17.2.4
date	99.09.05.11.01.59;	author peter;	state Exp;
branches;
next	;


desc
@@


1.21
log
@Make the cutover to periodic and cron.d as discussed to death on committers
for the past week.
@
text
@#!/bin/sh -
#
#	@@(#)weekly	5.14 (Berkeley) 6/23/91
#	$Id: weekly,v 1.20 1997/02/25 02:56:13 mpp Exp $

PATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/libexec
export PATH

host=`hostname -s`
echo "Subject: $host weekly run output"

#echo ""
#echo "Removing old .o files:"
#find /usr/src -name '*.o' -atime +21 -print -a -exec rm -f {} \;

# see if /usr/src exists and is local
# before looking there for checked-out files

#if [ -d /usr/src -a \
#  X"`find -f /usr/src ! -fstype local -prune -or -type d -print -prune`" != X ];
#then
#	echo "looking for checked out files:"
#	TDIR=/tmp/_checkout$$
#
#	mkdir $TDIR
#	for file in `find -f /usr/src ! -fstype local -prune -or \
#	    -name 'p.*' -print | egrep 'SCCS/p\.'`; do
#		owner=`awk '{ print $3 }' $file`
#		echo "$owner	$file"
#		echo $file >> $TDIR/$owner
#	done | sed -e 's,SCCS/p.,,'
#	for file in $TDIR/*; do
#		sed -e 's,SCCS/p.,,' $file | \
#		    Mail -s 'checked out files' `basename $file`
#	done
#	rm -rf $TDIR
#fi

if [ -f /usr/libexec/uucp/clean.weekly ]; then
	echo ""
	echo "Cleaning up UUCP:"
	echo /usr/libexec/uucp/clean.weekly | su daemon
fi

echo ""
echo "Rebuilding locate database:"
locdb=/var/db/locate.database
touch ${locdb}; chown nobody ${locdb}; chmod 644 ${locdb}
echo /usr/libexec/locate.updatedb | nice -5 su -fm nobody 2>&1 |\
	fgrep -v 'Permission denied'
chmod 444 ${locdb}

echo ""
echo "Rebuilding whatis database:"
if [ -d /usr/X11R6/man ]
then
	MANPATH=${MANPATH:-/usr/share/man:/usr/X11R6/man:/usr/local/man}
else
	MANPATH=${MANPATH:-/usr/share/man:/usr/local/man}
fi

makewhatis.local "${MANPATH}"

#echo ""
#echo "Reformatting manual pages:"
#echo catman.local "${MANPATH}" | su -fm man

echo ""
echo "Cleaning up kernel database files:"
kernel=`sysctl -n kern.bootfile`
kernel=kvm_`basename ${kernel}`.db
find /var/db -name "kvm_*.db" -a ! -name ${kernel} -a -atime +7 -exec rm -f -- {} \;

if [ -f /etc/weekly.local ]; then
    echo ""
    echo "Running weekly.local:"
    sh /etc/weekly.local
fi
@


1.20
log
@Don't include /usr/X11R6/man in the makewhatis search path if
it doesn't exist.  Closes PR# 326.
@
text
@d4 1
a4 1
#	$Id: weekly,v 1.19 1997/02/23 09:20:55 peter Exp $
@


1.19
log
@Revert $FreeBSD$ to $Id$
@
text
@d4 1
a4 1
#	$Id$
d55 6
a60 1
MANPATH=${MANPATH:-/usr/share/man:/usr/X11R6/man:/usr/local/man}
@


1.18
log
@Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
@
text
@d4 1
a4 1
#	$FreeBSD$
@


1.17
log
@Invoke weekly.local and monthly.local if they exist.

Suggested by:	jkh
@
text
@d4 1
a4 1
#	$Id: weekly,v 1.16 1996/05/18 20:30:04 nate Exp $
@


1.17.2.1
log
@YAMFC fix man path for no X
@
text
@d4 1
a4 1
#	$Id: weekly,v 1.17 1996/10/19 21:52:12 alex Exp $
a54 2
if [ -d /usr/X11R6/man ]
then
a55 3
else
MANPATH=${MANPATH:-/usr/share/man:/usr/local/man}
fi
@


1.17.2.2
log
@MFC: use manpath(1) to find the value of ${MANPATH}.

PR:		5365
Submitted by:	Ruslan Shevchenko <rssh@@cam.grad.kiev.ua>
@
text
@d4 1
a4 1
#	$Id: weekly,v 1.17.2.1 1997/02/25 17:52:00 adam Exp $
d53 8
a60 1
if [ -x /usr/libexec/makewhatis.local -a -x /usr/bin/manpath ] ; then
d62 1
a62 12
    echo ""
    echo "Rebuilding whatis database:"

    MANPATH=`/usr/bin/manpath -q`
    if [ $? = 0 ]; then
	if [ "x${MANPATH}" = "x" ]; then
	    echo "manpath failed to find any manpage directories"
	else
	    /usr/libexec/makewhatis.local "${MANPATH}"
	fi
    fi
fi
@


1.17.2.3
log
@MFC: Use FQDN instead of hostname in reports (bin/9091)
@
text
@d4 1
a4 1
#	$Id: weekly,v 1.17.2.2 1998/01/10 00:06:55 steve Exp $
d9 1
a9 1
host=`hostname`
@


1.17.2.4
log
@$Id$ -> $FreeBSD$
@
text
@d4 1
a4 1
# $FreeBSD$
@


1.16
log
@Fixed *annoying* error with the weekly files.  Do you get these whenver
/etc/weekly is run?

Rebuilding locate database: stty: stdin isn't a terminal TERM: Undefined
variable.

'su' apparently runs in root's environment before doing a seteuid(), so
it reads root's .cshrc.  The problem lies in the fact that $prompt is
*always* set by the time the command is executed, so you can't protect
your interactive commands from the non-interactive commands by the
normal:

if ($?prompt) then
   # interactive stuff here
endif

Set the -f flag (su -fm) which causes it not to read root's .cshrc file,
since there should be no reason to do so for these scripts since
/etc/crontab sets up all of the necessary environment.
@
text
@d4 1
a4 1
#	$Id: weekly,v 1.15 1996/05/13 22:05:10 wosch Exp $
d68 6
@


1.15
log
@catman -> catman.local

This is currently a no-op, because a wisely man did not
enable catman by default (in comments).
@
text
@d4 1
a4 1
#	$Id: weekly,v 1.14 1996/05/12 21:10:34 wosch Exp $
d49 1
a49 1
echo /usr/libexec/locate.updatedb | nice -5 su -m nobody 2>&1 |\
d61 1
a61 1
#echo catman.local "${MANPATH}" | su -m man
@


1.14
log
@makewhatis -> makewhatis.local
@
text
@d4 1
a4 1
#	$Id: $
d61 1
a61 1
#echo catman "${MANPATH}" | su man
@


1.13
log
@changed /etc/[daily,weekly,monthly] to not rotate the logfiles by
"hand", changed /etc/crontab to call /usr/sbin/newsyslog every hour
(the entry was there before - but we haven't had any newsyslog until
today :-) and changed /etc/inetd.conf to also contain (commentet out)
entries for rpc.rquotad and rpc.sprayd (taken from NetBSD)
@
text
@d4 1
a4 1
#
d57 1
a57 1
makewhatis "${MANPATH}"
@


1.12
log
@Change non-existent /usr/lib/uucp to /usr/libexec/uucp
@
text
@a43 22
echo ""

echo "Rotating messages:"
cd /var/log
if [ -f messages.2 ]; then mv -f messages.2 messages.3; fi
if [ -f messages.1 ]; then mv -f messages.1 messages.2; fi
if [ -f messages.0 ]; then mv -f messages.0 messages.1; fi
mv -f messages messages.0
cp /dev/null messages
chmod 644 messages
kill -1 `cat /var/run/syslog.pid`
cd /

echo "Rotating cron log:"
cd /var/cron
if [ -f log.2 ]; then mv -f log.2 log.3; fi
if [ -f log.1 ]; then mv -f log.1 log.2; fi
if [ -f log.0 ]; then mv -f log.0 log.1; fi
mv -f log log.0
cp /dev/null log
chmod 600 log
cd /
@


1.11
log
@Cleanup old kernel database files in /var/db.
@
text
@d39 1
a39 1
if [ -f /usr/lib/uucp/clean.weekly ]; then
d42 1
a42 1
	echo /usr/lib/uucp/clean.weekly | su daemon
@


1.10
log
@This is a purely cosmetic clean up.  Fix many cut and paste problems that
had turned tabs into spaces.
@
text
@d84 6
@


1.10.4.1
log
@Bring in changes from the HEAD.

Fixed *annoying* error where the following error is generated.

Rebuilding locate database:
stty: stdin isn't a terminal
TERM: Undefined variable.
@
text
@d71 1
a71 1
echo /usr/libexec/locate.updatedb | nice -5 su -fm nobody 2>&1 |\
@


1.10.4.2
log
@Merge from HEAD, except:

	Clients that used gnumalloc still do, despite the merge.  We're not
	bringing phkmalloc over.

	Thread stuff left out.

	PCCARD support left out.
@
text
@d4 1
a4 1
#	$Id$
d39 1
a39 1
if [ -f /usr/libexec/uucp/clean.weekly ]; then
d42 1
a42 1
	echo /usr/libexec/uucp/clean.weekly | su daemon
d44 22
d79 1
a79 1
makewhatis.local "${MANPATH}"
d83 1
a83 7
#echo catman.local "${MANPATH}" | su -fm man

echo ""
echo "Cleaning up kernel database files:"
kernel=`sysctl -n kern.bootfile`
kernel=kvm_`basename ${kernel}`.db
find /var/db -name "kvm_*.db" -a ! -name ${kernel} -a -atime +7 -exec rm -f -- {} \;
@


1.10.4.3
log
@This 3rd mega-commit should hopefully bring us back to where we were.
I can get it to `make world' succesfully, anyway!
@
text
@d4 1
a4 1
#
d39 1
a39 1
if [ -f /usr/lib/uucp/clean.weekly ]; then
d42 1
a42 1
	echo /usr/lib/uucp/clean.weekly | su daemon
a43 22
echo ""

echo "Rotating messages:"
cd /var/log
if [ -f messages.2 ]; then mv -f messages.2 messages.3; fi
if [ -f messages.1 ]; then mv -f messages.1 messages.2; fi
if [ -f messages.0 ]; then mv -f messages.0 messages.1; fi
mv -f messages messages.0
cp /dev/null messages
chmod 644 messages
kill -1 `cat /var/run/syslog.pid`
cd /

echo "Rotating cron log:"
cd /var/cron
if [ -f log.2 ]; then mv -f log.2 log.3; fi
if [ -f log.1 ]; then mv -f log.1 log.2; fi
if [ -f log.0 ]; then mv -f log.0 log.1; fi
mv -f log log.0
cp /dev/null log
chmod 600 log
cd /
d57 1
a57 1
makewhatis "${MANPATH}"
d61 7
a67 1
#echo catman "${MANPATH}" | su man
@


1.9
log
@Make the catman command (in the commented-out example) run by user `man'
instead of `root'.
@
text
@d51 2
a52 2
mv -f messages   messages.0
cp /dev/null  messages
d62 2
a63 2
mv -f log   log.0
cp /dev/null  log
d72 1
a72 1
        fgrep -v 'Permission denied'
d83 1
a83 1
#echo catman  "${MANPATH}" | su man
@


1.8
log
@Included the (now use{able,ful}) catman program as an (commented out)
example.
@
text
@d83 1
a83 1
#catman  "${MANPATH}"
@


1.7
log
@gettytab:

Add the `lc' option to default.  Having getty understand the issues of
CAPS-only terminals is a nop these days, but `lc' avoids hassles for
people with CAPS-only user names.

Suggested by: Don Yuniskis


weekly:

Modify the call to makewhatis, now that our makewhatis can take the
entire ${MANPATH} as a single argument.
@
text
@d80 4
@


1.6
log
@daily:
	Leave a warning to the sysop if (s)he didn't yet
	enable the /tmp cleanup code.
	Made `core' in the cleanup template look `*.core'.
	Replace `df -k' by `df -k -t local', since the stats
	for kernfs, procfs etc. are not of much interest, and
	the inclusion of nfs systems might  hang the machine (nor is it a
	`disk' statistic as the headline's telling).
weekly:
	Modified the locate.updatedb part to work even if there's no
	database yet; report errors other than `Permission denied' instead
	of silently ignoring all of them.
	Added functionality to rebuild the whatis database once a week.
@
text
@d79 1
a79 9
for mandir in `( IFS=":"; set -- ${MANPATH}; echo $* )`
do
        if [ ! -d ${mandir} ]
        then
                continue
        fi
        echo "==> ${mandir}"
        makewhatis ${mandir}
done
@


1.5
log
@Add rotattion of cron log to weekly.

Reviewed by:
Submitted by:	guido
@
text
@d69 19
a87 1
echo /usr/libexec/locate.updatedb | nice -5 su -m nobody 2>/dev/null
@


1.4
log
@Reenabled rotation of log files and killing of syslogd now that the
lockup problem is fixed.
@
text
@d57 10
@


1.3
log
@Disabled the scan for SCCS checked out files since it was broken and
caused error messages to be mailed, and FreeBSD does NOT have SCCS,
we use CVS!
@
text
@d46 10
a55 14
# Due to a console sub system bug doing the kill -1 of syslogd
# will lock up the console.  This has been disabled until that
# is fixed.
#
#echo "Rotating messages:"
#cd /var/log
#if [ -f messages.2 ]; then mv -f messages.2 messages.3; fi
#if [ -f messages.1 ]; then mv -f messages.1 messages.2; fi
#if [ -f messages.0 ]; then mv -f messages.0 messages.1; fi
#mv -f messages   messages.0
#cp /dev/null  messages
#chmod 644 messages
#kill -1 `cat /var/run/syslog.pid`
#cd /
@


1.2
log
@Due to the bug with the console drivers and kill syslogd I have disabled that
in the daily and weekly scripts so that we don't get bug reports about
something we already know.  There are explanory comments in the files.
@
text
@d19 19
a37 19
if [ -d /usr/src -a \
  X"`find -f /usr/src ! -fstype local -prune -or -type d -print -prune`" != X ];
then
	echo "looking for checked out files:"
	TDIR=/tmp/_checkout$$

	mkdir $TDIR
	for file in `find -f /usr/src ! -fstype local -prune -or \
	    -name 'p.*' -print | egrep 'SCCS/p\.'`; do
		owner=`awk '{ print $3 }' $file`
		echo "$owner	$file"
		echo $file >> $TDIR/$owner
	done | sed -e 's,SCCS/p.,,'
	for file in $TDIR/*; do
		sed -e 's,SCCS/p.,,' $file | \
		    Mail -s 'checked out files' `basename $file`
	done
	rm -rf $TDIR
fi
@


1.1
log
@Initial revision
@
text
@d46 14
a59 10
echo "Rotating messages:"
cd /var/log
if [ -f messages.2 ]; then mv -f messages.2 messages.3; fi
if [ -f messages.1 ]; then mv -f messages.1 messages.2; fi
if [ -f messages.0 ]; then mv -f messages.0 messages.1; fi
mv -f messages   messages.0
cp /dev/null  messages
chmod 644 messages
kill -1 `cat /var/run/syslog.pid`
cd /
@


1.1.1.1
log
@Initial import of 386BSD 0.1 othersrc/etc
@
text
@@
