Source code pulled from OpenBSD for OpenNTPD. The place to contribute to this code is via the OpenBSD CVS tree.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.6 KiB

29 years ago
  1. #!/bin/sh -
  2. #
  3. # $OpenBSD: weekly,v 1.3 1996/05/26 10:25:32 deraadt Exp $
  4. #
  5. PATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/libexec
  6. export PATH
  7. host=`hostname -s`
  8. echo "Subject: $host weekly run output"
  9. if [ -f /etc/weekly.local ];then
  10. echo ""
  11. echo "Running weekly.local:"
  12. . /etc/weekly.local
  13. fi
  14. #echo ""
  15. #echo "Removing old .o files:"
  16. #find /usr/src -name '*.o' -atime +21 -print -a -exec rm -f {} \;
  17. # see if /usr/src exists and is local
  18. # before looking there for checked-out files
  19. #if [ -d /usr/src -a \
  20. # X"`find -f /usr/src ! -fstype local -prune -or -type d -print -prune`" != X ];
  21. #then
  22. # echo "looking for checked out files:"
  23. # TDIR=/tmp/_checkout$$
  24. #
  25. # mkdir $TDIR
  26. # for file in `find -f /usr/src ! -fstype local -prune -or \
  27. # -name 'p.*' -print | egrep 'SCCS/p\.'`; do
  28. # owner=`awk '{ print $3 }' $file`
  29. # echo "$owner $file"
  30. # echo $file >> $TDIR/$owner
  31. # done | sed -e 's,SCCS/p.,,'
  32. # for file in $TDIR/*; do
  33. # sed -e 's,SCCS/p.,,' $file | \
  34. # Mail -s 'checked out files' `basename $file`
  35. # done
  36. # rm -rf $TDIR
  37. #fi
  38. if [ -f /usr/lib/uucp/clean.weekly ]; then
  39. echo ""
  40. echo "Cleaning up UUCP:"
  41. echo /usr/lib/uucp/clean.weekly | su daemon
  42. fi
  43. echo ""
  44. # Rotation of message log now handled automatically by cron and 'newsyslog'
  45. echo ""
  46. if [ -f /var/db/locate.database ]; then
  47. echo "Rebuilding locate database:"
  48. chmod 644 /var/db/locate.database
  49. chown nobody.nobody /var/db/locate.database
  50. echo /usr/libexec/locate.updatedb | nice -5 su -m nobody 2>/dev/null
  51. chown root.wheel /var/db/locate.database
  52. else
  53. echo "Not rebuilding locate database; no /var/db/locate.database"
  54. fi