1993-06-20 13:41:45 +00:00
|
|
|
#!/bin/sh -
|
|
|
|
#
|
|
|
|
# @(#)daily 5.12 (Berkeley) 5/24/91
|
|
|
|
#
|
1995-05-27 01:31:40 +00:00
|
|
|
PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
1993-06-20 13:41:45 +00:00
|
|
|
host=`hostname -s`
|
|
|
|
echo "Subject: $host daily run output"
|
|
|
|
bak=/var/backups
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "Removing scratch and junk files:"
|
|
|
|
if [ -d /var/preserve ]; then
|
|
|
|
cd /var/preserve && {
|
|
|
|
find . ! -name . -mtime +7 -exec rm -f -- {} \; ; }
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -d /var/rwho ] ; then
|
|
|
|
cd /var/rwho && {
|
|
|
|
find . ! -name . -mtime +7 -exec rm -f -- {} \; ; }
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd /tmp
|
1994-01-12 06:23:30 +00:00
|
|
|
# This is not safe, you need to decide what is appropriate for your
|
1994-10-30 18:20:58 +00:00
|
|
|
# system. Leave a warning note for now.
|
1994-11-20 23:34:51 +00:00
|
|
|
echo "You did not enable the cleaning of / in /etc/daily!"
|
1994-01-12 06:23:30 +00:00
|
|
|
#
|
|
|
|
#find / ! -fstype local -a -prune -o \
|
1994-10-30 18:20:58 +00:00
|
|
|
# \( -name '[#,]*' -o -name '.#*' -o -name a.out -o -name *.core \
|
1994-01-12 06:23:30 +00:00
|
|
|
# -o -name '*.CKP' -o -name '.emacs_[0-9]*' \) \
|
|
|
|
# -a -atime +3 -exec rm -f -- {} \;
|
|
|
|
#
|
1993-06-20 13:41:45 +00:00
|
|
|
msgs -c
|
|
|
|
if [ -f /etc/news.expire ]; then
|
|
|
|
/etc/news.expire
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "Backup passwd and group files:"
|
1995-09-15 00:31:38 +00:00
|
|
|
if [ ! -f $bak/master.passwd.bak ] ; then
|
|
|
|
echo "no $bak/master.passwd.bak"
|
|
|
|
cp -p /etc/master.passwd $bak/master.passwd.bak
|
|
|
|
fi
|
1993-06-20 13:41:45 +00:00
|
|
|
if cmp -s $bak/master.passwd.bak /etc/master.passwd; then :; else
|
|
|
|
echo "$host passwd diffs:"
|
|
|
|
diff $bak/master.passwd.bak /etc/master.passwd
|
|
|
|
mv $bak/master.passwd.bak $bak/master.passwd.bak2
|
|
|
|
cp -p /etc/master.passwd $bak/master.passwd.bak
|
|
|
|
fi
|
1995-09-15 00:31:38 +00:00
|
|
|
if [ ! -f $bak/group.bak ] ; then
|
|
|
|
echo "no $bak/group.bak"
|
|
|
|
cp -p /etc/group $bak/group.bak
|
|
|
|
fi
|
1993-06-20 13:41:45 +00:00
|
|
|
if cmp -s $bak/group.bak /etc/group; then :; else
|
1995-09-15 00:31:38 +00:00
|
|
|
echo "$host group diffs:"
|
|
|
|
diff $bak/group.bak /etc/group
|
1993-06-20 13:41:45 +00:00
|
|
|
mv $bak/group.bak $bak/group.bak2
|
|
|
|
cp -p /etc/group $bak/group.bak
|
|
|
|
fi
|
1995-09-15 00:31:38 +00:00
|
|
|
if [ ! -f $bak/aliases.bak ] ; then
|
|
|
|
echo "no $bak/aliases.bak"
|
|
|
|
cp -p /etc/aliases $bak/aliases.bak
|
|
|
|
fi
|
1993-06-20 13:41:45 +00:00
|
|
|
if cmp -s $bak/aliases.bak /etc/aliases; then :; else
|
1995-09-15 00:31:38 +00:00
|
|
|
echo "$host aliases diffs:"
|
|
|
|
diff $bak/aliases.bak /etc/aliases
|
1993-06-20 13:41:45 +00:00
|
|
|
mv $bak/aliases.bak $bak/aliases.bak2
|
|
|
|
cp -p /etc/aliases $bak/aliases.bak
|
|
|
|
fi
|
|
|
|
if [ -f /etc/Distfile ]; then
|
|
|
|
if cmp -s $bak/Distfile.bak /etc/Distfile; then :; else
|
|
|
|
mv $bak/Distfile.bak $bak/Distfile.bak2
|
|
|
|
cp /etc/Distfile $bak/Distfile.bak
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "Running calendar:"
|
|
|
|
calendar -a
|
|
|
|
|
|
|
|
if [ -d /var/spool/uucp -a -f /etc/uuclean.daily ]; then
|
|
|
|
echo ""
|
|
|
|
echo "Cleaning up UUCP:"
|
|
|
|
echo /etc/uuclean.daily | su daemon
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo ""
|
|
|
|
echo "Checking subsystem status:"
|
|
|
|
echo ""
|
|
|
|
echo "disks:"
|
1994-10-30 18:20:58 +00:00
|
|
|
df -k -t local
|
1993-06-20 13:41:45 +00:00
|
|
|
echo ""
|
|
|
|
dump W
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "mail:"
|
|
|
|
mailq
|
|
|
|
|
|
|
|
if [ -d /var/spool/uucp ]; then
|
|
|
|
echo ""
|
|
|
|
echo "uucp:"
|
1993-10-13 16:26:03 +00:00
|
|
|
uustat -a
|
1993-06-20 13:41:45 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "network:"
|
|
|
|
netstat -i
|
|
|
|
echo ""
|
|
|
|
ruptime
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
if [ -f /etc/Distfile ]; then
|
|
|
|
echo "Running rdist:"
|
|
|
|
rdist -f /etc/Distfile
|
|
|
|
fi
|
|
|
|
|
1995-05-27 01:31:40 +00:00
|
|
|
sh /etc/security 2>&1 | sendmail root
|