mandb.cron.daily 619 B

12345678910111213141516171819202122232425262728
  1. #! /bin/bash
  2. if [ -e /etc/sysconfig/man-db ]; then
  3. . /etc/sysconfig/man-db
  4. fi
  5. if [ "$CRON" = "no" ]; then
  6. exit 0
  7. fi
  8. renice +19 -p $$ >/dev/null 2>&1
  9. ionice -c3 -p $$ >/dev/null 2>&1
  10. LOCKFILE=/var/lock/man-db.lock
  11. # the lockfile is not meant to be perfect, it's just in case the
  12. # two man-db cron scripts get run close to each other to keep
  13. # them from stepping on each other's toes. The worst that will
  14. # happen is that they will temporarily corrupt the database
  15. [ -f $LOCKFILE ] && exit 0
  16. trap "{ rm -f $LOCKFILE ; exit 255; }" EXIT
  17. touch $LOCKFILE
  18. # create/update the mandb database
  19. mandb $OPTS
  20. exit 0