summaryrefslogtreecommitdiffstats
path: root/system/man-db/man-db.cron
diff options
context:
space:
mode:
author B. Watson2014-08-15 09:58:19 +0200
committer Willy Sudiarto Raharjo2014-08-15 18:21:33 +0200
commitb1e258732ea485dd4feb6d25dd2ae3f636dbfaef (patch)
treea6b0eceb0da7f56da97d89fc45e06b1910939b26 /system/man-db/man-db.cron
parent4c4f7066fc127ec5a20de1c5dad2ac1668cbd4e5 (diff)
downloadslackbuilds-b1e258732ea485dd4feb6d25dd2ae3f636dbfaef.tar.gz
system/man-db: Added (database-driven manual pager suite).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/man-db/man-db.cron')
-rw-r--r--system/man-db/man-db.cron23
1 files changed, 23 insertions, 0 deletions
diff --git a/system/man-db/man-db.cron b/system/man-db/man-db.cron
new file mode 100644
index 0000000000..d25bf3b5ec
--- /dev/null
+++ b/system/man-db/man-db.cron
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# man-db daily cronjob, part of the slackbuilds.org man-db package.
+# Author: B. Watson.
+# Adapted from Debian's man-db package, so I guess the license is GPL.
+
+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
+ chmod 2755 /var/cache/man
+fi
+
+# expunge old catman pages which have not been read in a week
+# commented out, as we've got cat pages disabled in this build. Left
+# here for reference in case someone really wants to enable cat pages
+# 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