summaryrefslogtreecommitdiffstats
path: root/abs/core/man-db/man-db.cron.daily
diff options
context:
space:
mode:
authorJames Meyer <jams@linhes.org>2010-12-04 23:48:49 (GMT)
committerJames Meyer <jams@linhes.org>2010-12-04 23:48:49 (GMT)
commit037ab1a6a2fee07c83b47dc4d4ffd629b9052e85 (patch)
treea4256da38a768da362aad34ad9a8bcc7da611c30 /abs/core/man-db/man-db.cron.daily
parent0b251e4b5f6d56e5aba84aaf780fbf4e6a289245 (diff)
parent2ddfcdc1360af607e5925afe0e0f3562ad538738 (diff)
downloadlinhes_pkgbuild-037ab1a6a2fee07c83b47dc4d4ffd629b9052e85.zip
linhes_pkgbuild-037ab1a6a2fee07c83b47dc4d4ffd629b9052e85.tar.gz
linhes_pkgbuild-037ab1a6a2fee07c83b47dc4d4ffd629b9052e85.tar.bz2
Merge branch 'testing' of ssh://linhes.org/mount/repository/linhes_pkgbuild into testing
Diffstat (limited to 'abs/core/man-db/man-db.cron.daily')
-rwxr-xr-xabs/core/man-db/man-db.cron.daily39
1 files changed, 39 insertions, 0 deletions
diff --git a/abs/core/man-db/man-db.cron.daily b/abs/core/man-db/man-db.cron.daily
new file mode 100755
index 0000000..53e66e1
--- /dev/null
+++ b/abs/core/man-db/man-db.cron.daily
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# nicenesses range from -20 (most favorable scheduling) to 19 (least favorable)
+NICE=19
+
+# 0 for none, 1 for real time, 2 for best-effort, 3 for idle
+IONICE_CLASS=2
+
+# 0-7 (for IONICE_CLASS 1 and 2 only), 0=highest, 7=lowest
+IONICE_PRIORITY=7
+
+UPDATEMANDB="/usr/bin/mandb --quiet"
+
+# Update the "whatis" database
+#/usr/sbin/makewhatis -u -w
+
+# taken from Debian
+# man-db cron daily
+set -e
+
+if ! [ -d /var/cache/man ]; then
+ # Recover from deletion, per FHS.
+ mkdir -p /var/cache/man
+ chmod 755 /var/cache/man
+fi
+
+# regenerate man database
+
+if [ -x /usr/bin/nice ]; then
+ UPDATEMANDB="/usr/bin/nice -n ${NICE:-19} ${UPDATEMANDB}"
+fi
+
+if [ -x /usr/bin/ionice ]; then
+ UPDATEMANDB="/usr/bin/ionice -c ${IONICE_CLASS:-2} -n ${IONICE_PRIORITY:-7} ${UPDATEMANDB}"
+fi
+
+${UPDATEMANDB}
+
+exit 0