|
#!/bin/sh -
|
|
#
|
|
# $OpenBSD: weekly,v 1.16 2005/11/19 15:13:34 jmc Exp $
|
|
#
|
|
|
|
PATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/libexec
|
|
export PATH
|
|
|
|
if [ -f /etc/weekly.local ]; then
|
|
echo ""
|
|
echo "Running weekly.local:"
|
|
. /etc/weekly.local
|
|
fi
|
|
|
|
echo ""
|
|
if [ -f /var/db/locate.database ]; then
|
|
TMP=`mktemp /var/db/locate.database.XXXXXXXXXX`
|
|
if [ $? -eq 0 ]; then
|
|
trap 'rm -f $TMP' 0 1 15
|
|
echo "Rebuilding locate database:"
|
|
UPDATEDB="/usr/libexec/locate.updatedb"
|
|
echo "${UPDATEDB} --fcodes=- --tmpdir=${TMPDIR:-/var/tmp}" | \
|
|
nice -5 su -m nobody 2>/dev/null 1>$TMP
|
|
if [ -s "$TMP" ]; then
|
|
chmod 444 $TMP
|
|
chown root:wheel $TMP
|
|
mv -f $TMP /var/db/locate.database
|
|
else
|
|
echo "Not installing locate database; zero size"
|
|
fi
|
|
else
|
|
echo "Not rebuilding locate database; can't create temp file"
|
|
fi
|
|
else
|
|
echo "Not rebuilding locate database; no /var/db/locate.database"
|
|
fi
|
|
|
|
echo ""
|
|
echo "Rebuilding whatis databases:"
|
|
makewhatis
|
|
|
|
# echo ""
|
|
# echo "Doing login accounting:"
|
|
# ac -p | sort -nr +1
|