summaryrefslogtreecommitdiff
path: root/system/man-db/man-db.cron
diff options
context:
space:
mode:
Diffstat (limited to 'system/man-db/man-db.cron')
-rw-r--r--system/man-db/man-db.cron13
1 files changed, 10 insertions, 3 deletions
diff --git a/system/man-db/man-db.cron b/system/man-db/man-db.cron
index d25bf3b5ec..93c3a00ff2 100644
--- a/system/man-db/man-db.cron
+++ b/system/man-db/man-db.cron
@@ -9,7 +9,7 @@ set -e
if ! [ -d /var/cache/man ]; then
# Recover from deletion, per FHS.
mkdir -p /var/cache/man
- chown man:root /var/cache/man || true
+ chown root:root /var/cache/man || true
chmod 2755 /var/cache/man
fi
@@ -19,5 +19,12 @@ fi
# some day.
#find /var/cache/man -type f -name '*.gz' -atime +6 -print0 | xargs -r0 rm -f &> /dev/null
-# regenerate man database
-[ -x /opt/man-db/bin/mandb ] && /opt/man-db/bin/mandb --no-purge --quiet
+# regenerate man database. /opt/man-db/bin probably isn't in cron's $PATH,
+# so check for it specially, otherwise use $PATH.
+if [ -x /opt/man-db/bin/mandb ]; then
+ MANDB=/opt/man-db/bin/mandb
+else
+ MANDB=mandb
+fi
+
+$MANDB --no-purge --quiet