|
@ -1,6 +1,6 @@ |
|
|
#!/bin/sh - |
|
|
#!/bin/sh - |
|
|
# |
|
|
# |
|
|
# $OpenBSD: daily,v 1.13 1996/12/07 07:33:06 bitblt Exp $ |
|
|
|
|
|
|
|
|
# $OpenBSD: daily,v 1.14 1996/12/07 18:46:46 millert Exp $ |
|
|
# |
|
|
# |
|
|
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local |
|
|
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local |
|
|
host=`hostname -s` |
|
|
host=`hostname -s` |
|
@ -12,6 +12,12 @@ if [ -f /etc/daily.local ];then |
|
|
. /etc/daily.local |
|
|
. /etc/daily.local |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
TMP=`mktemp /tmp/_daily.XXXXXX` || { |
|
|
|
|
|
ls -ldgT $TMP |
|
|
|
|
|
exit 1 |
|
|
|
|
|
} |
|
|
|
|
|
trap 'rm -f $TMP' 0 1 15 |
|
|
|
|
|
|
|
|
echo "" |
|
|
echo "" |
|
|
echo "NOT Removing scratch and junk files." |
|
|
echo "NOT Removing scratch and junk files." |
|
|
#echo "Removing scratch and junk files:" |
|
|
#echo "Removing scratch and junk files:" |
|
@ -44,19 +50,7 @@ echo "NOT Removing scratch and junk files." |
|
|
# XXX NOT REMOVING UNTIL SECURITY BUG IS FIXED |
|
|
# XXX NOT REMOVING UNTIL SECURITY BUG IS FIXED |
|
|
# find . ! -name . -mtime +7 -exec rm -f -- {} \; ; } |
|
|
# find . ! -name . -mtime +7 -exec rm -f -- {} \; ; } |
|
|
#fi |
|
|
#fi |
|
|
TDIR=/tmp/daily.$$ |
|
|
|
|
|
if ! mkdir $TDIR ; then |
|
|
|
|
|
printf "tmp directory %s already exists, looks like:\n" $TDIR |
|
|
|
|
|
ls -alf $TDIR |
|
|
|
|
|
exit 1 |
|
|
|
|
|
fi |
|
|
|
|
|
cd $TDIR |
|
|
|
|
|
trap 'rm -rf $TDIR' 0 1 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TMP=daily.$$ |
|
|
|
|
|
rm -f $TMP |
|
|
|
|
|
echo -n > $TMP |
|
|
|
|
|
find / \( ! -fstype local -o -fstype rdonly -o -fstype fdesc \ |
|
|
find / \( ! -fstype local -o -fstype rdonly -o -fstype fdesc \ |
|
|
-o -fstype kernfs -o -fstype procfs \) -a -prune -o \ |
|
|
-o -fstype kernfs -o -fstype procfs \) -a -prune -o \ |
|
|
-name 'lost+found' -a -prune -o \ |
|
|
-name 'lost+found' -a -prune -o \ |
|
@ -65,13 +59,16 @@ find / \( ! -fstype local -o -fstype rdonly -o -fstype fdesc \ |
|
|
# -o -name '*.CKP' -o -name '.emacs_[0-9]*' \) \ |
|
|
# -o -name '*.CKP' -o -name '.emacs_[0-9]*' \) \ |
|
|
# -a -atime +3 -exec rm -f -- {} \; -a -print > $TMP |
|
|
# -a -atime +3 -exec rm -f -- {} \; -a -print > $TMP |
|
|
|
|
|
|
|
|
echo "" |
|
|
|
|
|
echo "Possible core dumps:" |
|
|
|
|
|
egrep '\.core' $TMP |
|
|
|
|
|
|
|
|
if egrep -q '\.core$' $TMP; then |
|
|
|
|
|
echo "" |
|
|
|
|
|
echo "Possible core dumps:" |
|
|
|
|
|
egrep '\.core$' $TMP |
|
|
|
|
|
|
|
|
#echo "" |
|
|
|
|
|
#echo "Deleted files:" |
|
|
|
|
|
#egrep -v '\.core' $TMP |
|
|
|
|
|
|
|
|
# XXX - we aren't deleting files due to security bug mentioned above |
|
|
|
|
|
#echo "" |
|
|
|
|
|
#echo "Deleted files:" |
|
|
|
|
|
#egrep -v '\.core$' $TMP |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
rm -f $TMP |
|
|
rm -f $TMP |
|
|
|
|
|
|
|
@ -93,9 +90,9 @@ fi |
|
|
|
|
|
|
|
|
echo "" |
|
|
echo "" |
|
|
if [ -d /var/yp/binding -a ! -d /var/yp/`domainname` ]; then |
|
|
if [ -d /var/yp/binding -a ! -d /var/yp/`domainname` ]; then |
|
|
echo "Not running calendar, (yp client)" |
|
|
|
|
|
|
|
|
echo "Not running calendar, (yp client)." |
|
|
else |
|
|
else |
|
|
echo "Running calendar:" |
|
|
|
|
|
|
|
|
echo "Running calendar." |
|
|
calendar -a |
|
|
calendar -a |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
@ -132,7 +129,10 @@ echo "" |
|
|
echo "network:" |
|
|
echo "network:" |
|
|
netstat -i |
|
|
netstat -i |
|
|
echo "" |
|
|
echo "" |
|
|
ruptime |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ -d /var/rwho ]; then |
|
|
|
|
|
ruptime |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
echo "" |
|
|
echo "" |
|
|
echo "NOT checking filesystems." |
|
|
echo "NOT checking filesystems." |
|
|