home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 4.ddi / sbin / cleanup < prev    next >
Encoding:
Text File  |  1990-12-08  |  1.6 KB  |  69 lines

  1. #!/sbin/sh
  2.  
  3.  
  4. #ident    "@(#)/sbin/cleanup.sl 1.1 4.0 12/08/90 51718 AT&T-USL"
  5. #
  6. # Perform once per week, Sunday Morning at 5:17 (via cron).
  7. #
  8.  
  9. #----------------------------------------------
  10. # clean up the super-user log
  11. #----------------------------------------------
  12. if [ -f /var/adm/sulog ]
  13. then mv /var/adm/sulog /var/adm/Osulog
  14. fi
  15. > /var/adm/sulog
  16. chmod 600 /var/adm/sulog
  17.  
  18. #----------------------------------------------
  19. # clean up the volcopy log
  20. #----------------------------------------------
  21. if [ -f /var/adm/log/filesave.log ]
  22. then mv /var/adm/log/filesave.log /var/adm/log/Ofilesave.log
  23. fi
  24. > /var/adm/log/filesave.log
  25. chown root /var/adm/log/filesave.log
  26. chgrp sys /var/adm/log/filesave.log
  27. chmod 666 /var/adm/log/filesave.log
  28.  
  29. #----------------------------------------------
  30. # clean up the wtmp file
  31. #----------------------------------------------
  32. > /var/adm/wtmp
  33. if [ ! -f /etc/wtmp ]
  34. then rm -rf /etc/wtmp
  35.      ln -s /var/adm/wtmp /etc/wtmp
  36. elif [ ! -h /etc/wtmp ]
  37. then rm -rf /etc/wtmp
  38.      ln -s /var/adm/wtmp /etc/wtmp
  39. fi
  40. > /var/adm/wtmpx
  41.  
  42. #----------------------------------------------
  43. # clean up core files
  44. #----------------------------------------------
  45. ( cd /
  46.     for i in *
  47.     do
  48.         [ -d $i ] || continue
  49.         case $i in
  50.             subnet)    continue;;
  51.             export)    continue;;
  52.         esac
  53.         find $i -local -name core -atime +7 -exec rm -f {} \;
  54.     done
  55. )
  56.  
  57. #----------------------------------------------
  58. # clean up the lost+found directory
  59. #----------------------------------------------
  60. if [ ! -d /lost+found ]
  61. then
  62.     mkdir /lost+found
  63.     chown root /lost+found    
  64.     chgrp root /lost+found    
  65.     chmod 755 /lost+found
  66. fi
  67. touch /lost+found
  68. find /lost+found -mtime +14 -exec rm -rf {} \; >/dev/null 2>&1
  69.