home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / private / adm / daily next >
Text File  |  1992-02-07  |  618b  |  28 lines

  1. #
  2. # /usr/adm/daily
  3. #
  4. # This /bin/sh script is run once a day by cron.  Put any housekeeping
  5. # commands in here, like pruning of log files
  6. #
  7.  
  8. # Trim the messages logfile
  9. cp -p /usr/adm/messages /usr/adm/messages.old
  10. /usr/ucb/tail -200 /usr/adm/messages.old > /usr/adm/messages
  11.  
  12. # Trim the /usr/spool/mqueue logfiles
  13. cd /usr/spool/mqueue
  14. for i in syslog
  15. do
  16.     if [ -r $i ]
  17.     then
  18.         cp -p $i $i.old
  19.         /usr/ucb/tail -200 $i.old > $i 
  20.     fi
  21. done
  22.  
  23. # Remove old preserve files
  24. find /private/preserve -mtime +7 -a -exec rm -f {} \;
  25.  
  26. # Clean out old .nfs files.
  27. find / -name .nfs\* -mtime +7 -exec rm -f {} \; -o -fstype nfs -prune
  28.