mandb.cron.daily 794 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/sh
  2. # nicenesses range from -20 (most favorable scheduling) to 19 (least favorable)
  3. NICE=19
  4. # 0 for none, 1 for real time, 2 for best-effort, 3 for idle
  5. IONICE_CLASS=2
  6. # 0-7 (for IONICE_CLASS 1 and 2 only), 0=highest, 7=lowest
  7. IONICE_PRIORITY=7
  8. CMD_MANDB="/usr/bin/mandb --quiet"
  9. # Update the "whatis" database
  10. #/usr/bin/makewhatis -u -w
  11. # taken from Debian
  12. # man-db cron daily
  13. set -e
  14. if ! [ -d /var/cache/man ]; then
  15. # Recover from deletion, per FHS.
  16. mkdir -p /var/cache/man
  17. chmod 755 /var/cache/man
  18. fi
  19. # regenerate man database
  20. if [ -x /usr/bin/nice ]; then
  21. CMD_MANDB="/usr/bin/nice -n ${NICE:-19} ${CMD_MANDB}"
  22. fi
  23. if [ -x /usr/bin/ionice ]; then
  24. CMD_MANDB="/usr/bin/ionice -c ${IONICE_CLASS:-2} -n ${IONICE_PRIORITY:-7} ${CMD_MANDB}"
  25. fi
  26. ${CMD_MANDB}
  27. exit 0