[BACK]Return to weekly CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / etc

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/etc/weekly between version 1.6 and 1.24

version 1.6, 1997/01/05 11:21:10 version 1.24, 2010/12/27 03:38:52
Line 1 
Line 1 
 #!/bin/sh -  #!/bin/sh -
 #  #
 #       $NetBSD$  #       $NetBSD$
 #       @(#)weekly      5.14 (Berkeley) 6/23/91  #       from: @(#)weekly        8.2 (Berkeley) 1/2/94
 #  #
   
 PATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/libexec  export PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/libexec
 export PATH  
   
 umask 077  umask 077
   
 host=`hostname -s`  
 echo "Subject: $host weekly run output"  
   
 if [ -s /etc/weekly.conf ]; then  if [ -s /etc/weekly.conf ]; then
         . /etc/weekly.conf          . /etc/weekly.conf
 fi  fi
   
   host="$(hostname)"
   date="$(date)"
   rcvar_manpage='weekly.conf(5)'
   
   echo "To: ${MAILTO:-root}"
   echo "Subject: $host weekly output for $date"
   echo ""
   
   if [ -f /etc/rc.subr ]; then
           . /etc/rc.subr
   else
           echo "Can't read /etc/rc.subr; aborting."
           exit 1;
   fi
   
   WEEKLYDIR=$(mktemp -d -t _weekly) || exit 1
   
   trap "/bin/rm -rf $WEEKLYDIR ; exit 0" EXIT INT QUIT PIPE
   
   if ! cd "$WEEKLYDIR"; then
           echo "Can not cd to $WEEKLYDIR".
           exit 1
   fi
   
   TMP=weekly.$$
   
 #echo ""  #echo ""
 #echo "Removing old .o files:"  #echo "Removing old .o files:"
 #find /usr/src -name '*.o' -atime +21 -print -a -exec rm -f {} \;  #find /usr/src -name '*.o' -atime +21 -print -a -exec rm -f {} \;
Line 24  fi
Line 45  fi
 # before looking there for checked-out files  # before looking there for checked-out files
   
 #if [ -d /usr/src -a \  #if [ -d /usr/src -a \
 #  X"`find -f /usr/src ! -fstype local -prune -or -type d -print -prune`" != X ];  #  -n "$(find -f /usr/src ! -fstype local -prune -or -type d -print -prune)" ];
 #then  #then
 #       echo "looking for checked out files:"  #       echo ""
 #       TDIR=/tmp/_checkout$$  #       echo "Looking for checked out files:"
 #  #
 #       mkdir $TDIR  #       TDIR=$(mktemp -d -t _checkout) || exit 1
 #       for file in `find -f /usr/src ! -fstype local -prune -or \  #       trap "/bin/rm -rf $TDIR ; exit 0" EXIT INT QUIT
 #           -name 'p.*' -print | egrep 'SCCS/p\.'`; do  #       for file in $(find -f /usr/src ! -fstype local -prune -or \
 #               owner=`awk '{ print $3 }' $file`  #           -name 'p.*' -print | egrep 'SCCS/p\.'); do
   #               owner=$(awk '{ print $3 }' $file)
 #               echo "$owner    $file"  #               echo "$owner    $file"
 #               echo $file >> $TDIR/$owner  #               echo $file >> "$TDIR/$owner"
 #       done | sed -e 's,SCCS/p.,,'  #       done | sed -e 's,SCCS/p.,,'
 #       for file in $TDIR/*; do  #       if test -n "$(ls $TDIR)"; then
 #               sed -e 's,SCCS/p.,,' $file | \  #               for file in $TDIR/*; do
 #                   Mail -s 'checked out files' `basename $file`  #                       sed -e 's,SCCS/p.,,' $file | \
 #       done  #                           Mail -s 'checked out files' ${file##*/}
 #       rm -rf $TDIR  #               done
   #       fi
 #fi  #fi
   
 if [ X"$clean_uucp" != XNO -a -f /usr/lib/uucp/clean.weekly ]; then  if checkyesno rebuild_locatedb; then
         echo ""          echo ""
         echo "Cleaning up UUCP:"          if [ -f /var/db/locate.database ]; then
         echo /usr/lib/uucp/clean.weekly | su daemon                  echo "Rebuilding locate database:"
                   chmod 644 /var/db/locate.database
                   chown nobody:nobody /var/db/locate.database
                   (cd / && nice -5 su -m nobody -c /usr/libexec/locate.updatedb 2>/dev/null)
                   chown root:wheel /var/db/locate.database
           else
                   echo "Not rebuilding locate database; no /var/db/locate.database"
           fi
 fi  fi
 echo ""  
   
 echo ""  if checkyesno rebuild_whatisdb; then
 if [ X"$rebuild_locatedb" != XNO -a -f /var/db/locate.database ]; then          echo ""
         echo "Rebuilding locate database:"          if [ -f /etc/man.conf -o -d /usr/share/man ]; then
         chmod 644 /var/db/locate.database                  echo "Rebuilding whatis databases:"
         chown nobody.nobody /var/db/locate.database                  nice -n 5 /usr/libexec/makewhatis -f
         echo /usr/libexec/locate.updatedb | nice -5 su -m nobody 2>/dev/null          else
         chown root.wheel /var/db/locate.database                  echo "Not rebuilding whatis databases"
 else          fi
         echo "Not rebuilding locate database; no /var/db/locate.database"  fi
   
   if [ -f /etc/weekly.local ]; then
           . /etc/weekly.local > $TMP 2>&1
           if [ -s $TMP ] ; then
                   printf "\nRunning /etc/weekly.local:\n"
                   cat $TMP
           fi
           rm -f $TMP
 fi  fi

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.24

CVSweb <webmaster@jp.NetBSD.org>