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.

44 lines
1010 B

  1. #!/bin/sh -
  2. #
  3. # $OpenBSD: weekly,v 1.16 2005/11/19 15:13:34 jmc Exp $
  4. #
  5. PATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/libexec
  6. export PATH
  7. if [ -f /etc/weekly.local ]; then
  8. echo ""
  9. echo "Running weekly.local:"
  10. . /etc/weekly.local
  11. fi
  12. echo ""
  13. if [ -f /var/db/locate.database ]; then
  14. TMP=`mktemp /var/db/locate.database.XXXXXXXXXX`
  15. if [ $? -eq 0 ]; then
  16. trap 'rm -f $TMP' 0 1 15
  17. echo "Rebuilding locate database:"
  18. UPDATEDB="/usr/libexec/locate.updatedb"
  19. echo "${UPDATEDB} --fcodes=- --tmpdir=${TMPDIR:-/var/tmp}" | \
  20. nice -5 su -m nobody 2>/dev/null 1>$TMP
  21. if [ -s "$TMP" ]; then
  22. chmod 444 $TMP
  23. chown root:wheel $TMP
  24. mv -f $TMP /var/db/locate.database
  25. else
  26. echo "Not installing locate database; zero size"
  27. fi
  28. else
  29. echo "Not rebuilding locate database; can't create temp file"
  30. fi
  31. else
  32. echo "Not rebuilding locate database; no /var/db/locate.database"
  33. fi
  34. echo ""
  35. echo "Rebuilding whatis databases:"
  36. makewhatis
  37. # echo ""
  38. # echo "Doing login accounting:"
  39. # ac -p | sort -nr +1