# @(#)daily 5.12 (Berkeley) 5/24/91
PATH
=/bin
:/usr
/bin
:/sbin
:/usr
/sbin
:/usr
/local
echo "Subject: $host daily run output"
echo "Removing scratch and junk files:"
find .
-type f
-atime +3 -exec rm -f -- {} \
;
find .
! -name .
-type d
-mtime +1 -exec rmdir -- {} \
; \
find .
! -name .
-atime +7 -exec rm -f -- {} \
;
find .
! -name .
-type d
-mtime +1 -exec rmdir -- {} \
; \
find .
! -name .
-atime +1 -exec rm -f -- {} \
;
find .
! -name .
-type d
-mtime +1 -exec rmdir -- {} \
; \
if [ -d /var
/preserve
]; then
find .
! -name .
-mtime +7 -exec rm -f -- {} \
; ; }
if [ -d /var
/rwho
] ; then
find .
! -name .
-mtime +7 -exec rm -f -- {} \
; ; }
find / ! -fstype local -a -prune -o \
\
( -name '[#,]*' -o -name '.#*' -o -name a.out
-o -name core \
-o -name '*.CKP' -o -name '.emacs_[0-9]*' \
) \
-a -atime +3 -exec rm -f -- {} \
;
if [ -f /etc
/news.expire
]; then
echo "Purging accounting records:"
mv /var
/account
/acct
.2 /var
/account
/acct
.3
mv /var
/account
/acct
.1 /var
/account
/acct
.2
mv /var
/account
/acct
.0 /var
/account
/acct
.1
cp /var
/account
/acct
/var
/account
/acct
.0
echo "Backup passwd and group files:"
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
if cmp -s $bak/group.bak
/etc
/group
; then :; else
mv $bak/group.bak
$bak/group.bak2
cp -p /etc
/group
$bak/group.bak
if cmp -s $bak/aliases.bak
/etc
/aliases
; then :; else
mv $bak/aliases.bak
$bak/aliases.bak2
cp -p /etc
/aliases
$bak/aliases.bak
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
echo "Rotating mail log:"
if [ -f maillog
.6 ]; then mv -f maillog
.6 maillog
.7; fi
if [ -f maillog
.5 ]; then mv -f maillog
.5 maillog
.6; fi
if [ -f maillog
.4 ]; then mv -f maillog
.4 maillog
.5; fi
if [ -f maillog
.3 ]; then mv -f maillog
.3 maillog
.4; fi
if [ -f maillog
.2 ]; then mv -f maillog
.2 maillog
.3; fi
if [ -f maillog
.1 ]; then mv -f maillog
.1 maillog
.2; fi
if [ -f maillog
.0 ]; then mv -f maillog
.0 maillog
.1; fi
kill -1 `cat /var/run/syslog.pid`
if [ -d /var
/spool
/uucp -a -f /etc
/uuclean.daily
]; then
echo /etc
/uuclean.daily | su daemon
echo "Checking subsystem status:"
if [ -d /var
/spool
/uucp ]; then
echo "Checking filesystems:"
fsck
-n |
grep -v '^\*\* Phase'
if [ -f /etc
/Distfile
]; then
sh
/etc
/security |
mail -s "daily insecurity output" root