home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2 / Openstep-4.2-Intel-User.iso / private / adm / daily next >
Text File  |  1992-12-22  |  697b  |  32 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 - but not when off the network.
  27.  
  28. if [ `/bin/hostname` != localhost ]; then
  29.     find / -name .nfs\* -mtime +7 -exec rm -f {} \; -o -fstype nfs -prune
  30. fi
  31.  
  32.