]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
findutils: Run updatedb once a week
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 24 Aug 2014 12:46:06 +0000 (14:46 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 24 Aug 2014 12:46:06 +0000 (14:46 +0200)
As suggested in bug #10303

config/findutils/updatedb [new file with mode: 0644]
config/rootfiles/common/fcron
config/rootfiles/common/findutils
lfs/findutils

diff --git a/config/findutils/updatedb b/config/findutils/updatedb
new file mode 100644 (file)
index 0000000..bc4809f
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+[ -x "/usr/bin/updatedb" ] || exit 0
+
+LOCKFILE="/var/lib/locate/updatedb.lock"
+
+trap "rm -f $LOCKFILE" EXIT
+
+if [ -e "$LOCKFILE" ]; then
+       echo >&2 "Warning: $LOCKFILE present, not running updatedb."
+       exit 1
+else
+       touch "$LOCKFILE"
+fi
+
+exec /usr/bin/updatedb
index b3a1c49606f1817aeffd974604200f0585532518..89f68a76ccf391f353f147c0df31cfc0519b93bd 100644 (file)
@@ -11,7 +11,6 @@ etc/fcron.hourly/info.txt
 etc/fcron.minutely/info.txt
 #etc/fcron.monthly
 etc/fcron.monthly/info.txt
-#etc/fcron.weekly
 etc/fcron.weekly/info.txt
 usr/bin/fcronsighup
 usr/bin/fcrontab
index 13cae26eb880da30124d918248af1c0ba300244f..ac4fffe95161109fc79d92f01c2551ec46d61f65 100644 (file)
@@ -1,3 +1,5 @@
+#etc/fcron.weekly
+etc/fcron.weekly/updatedb
 bin/find
 usr/bin/locate
 #usr/bin/oldfind
index c05aca3cb712f853996ef290898d29a264ea5141..e2dd04a02296e15ec50569911d370cc9f62bbbd3 100644 (file)
@@ -91,6 +91,10 @@ ifeq "$(ROOT)" ""
        mv -v /usr/bin/find /bin
        sed -i -e 's|BINDIR=/usr/bin|BINDIR=/bin|' /usr/bin/updatedb
        -mkdir -p /var/lib/locate
+
+       -mkdir -pv /etc/fcron.weekly
+       install -v -m 754 $(DIR_SRC)/config/findutils/updatedb \
+               /etc/fcron.weekly/updatedb
 endif
        @rm -rf $(DIR_APP)
        @$(POSTBUILD)