findutils: Run updatedb once a week

As suggested in bug #10303
This commit is contained in:
Michael Tremer
2014-08-24 14:46:06 +02:00
parent 9bd0bfd233
commit bfea8d7d2f
4 changed files with 22 additions and 1 deletions

16
config/findutils/updatedb Normal file
View File

@@ -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

View 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

View File

@@ -1,3 +1,5 @@
#etc/fcron.weekly
etc/fcron.weekly/updatedb
bin/find
usr/bin/locate
#usr/bin/oldfind

View 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)