updatedb -> PRUNE_FS: how to declare what's to be left out?
SUSE / openSUSEThis Forum is for the discussion of Suse Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Rep:
updatedb -> PRUNE_FS: how to declare what's to be left out?
Okay, when I opened /etc/updatedb.conf it says there in the file that one should make ones own updatedb.local. But how, exactly? Presumably I create /etc/updatedb.local but what do I put into that? With all those $-signs I'm pretty much lost. Could anyone post his/her example of a PRUNE_FS statement or point me to some reference where I can read up on this? Thanks in advance.
Like rweaver said PRUNEFS is a quoted, space separated list of file system names (as in '( sed -e "s|^nodev||g" /proc/filesystems; find /lib/modules/`uname -r`/kernel/fs -type f -print0|xargs -0 -iX basename 'X' .ko | grep -v nls ) | xargs' minus the ones you do use) and PRUNEPATHS is a quoted, space separated list of directory names rooted in "/" (like "/afs /media /sfs /tmp /udev /var/spool/squid") it should not traverse. To clarify this is not an "or" situation: you're free to use both directives.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Original Poster
Rep:
Quote:
Originally Posted by rweaver
You pretty much have two directives you might use--...
Thanks, rweaver, I am aware of that. I want to exclude my backups etc. so PRUNE_FS it is.
Quote:
Originally Posted by rweaver
...you shouldn't need to heavily modify the file.
My question is (and was) how, exactly, do I do that. When you look at SuSE's /etc/updatedb.conf you'll notice what I mean: What is the syntax I am to use in /etc/updatedb.local? It never says so or gives an example, so if you could paste yours here that would be a big help...
The tricks of the true master . But what is the syntax I have to use in /etc/updatedb.local? Look into /etc/updatedb.conf and you'll see what I mean...
The local version will typically be formatted the same as the conf itself. Just keep your simple you don't need anything complex like finds or variables or anything.
PRUNEPATH="/backups /backups2"
It's not hard to update the db, so try it and see if it worked, if it doesn't try an alternate way
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Original Poster
Rep:
No, it wont. The .conf uses (shell)-variables with lots of $-signs. Ah, I just noticed in your user panel that you don't have a SuSE system. So that's why we "didn't get a connection".
But I can certainly use your suggestion in a brute force try, blocking out everything but /boot (which is also a very small partition). Then I'll know it works or just kill the new db.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Original Poster
Rep:
Uargh. That comes from doing things from memory. And sorry to be back so late, I had a surprise call to leave town for a few days...
Now, in SuSE it is a cron job and not a .config file. This is the relevant file controling cron:
/etc/cron.daily/suse.de-updatedb
Code:
#!/bin/sh
#
#
# updatedb. This script was split off cron.daily.
# Please add your local changes to cron.daily.local
# since this file will be overwritten, when updating your system.
#
# Copyright (c) 2003 SuSE Linux AG, Nuernberg, Germany.
#
# Please submit bugfixes or comments via http://www.suse.de/feedback/
#
# Author: Burchard Steinbild <bs@suse.de>, 1996
# Florian La Roche <florian@suse.de>, 1996
#
#
#
#
# paranoia settings
#
umask 022
PATH=/sbin:/bin:/usr/sbin:/usr/bin
export PATH
#
# get information from /etc/rc.config
#
if [ -f /etc/sysconfig/locate ] ; then
. /etc/sysconfig/locate
fi
#
# update database for locate
#
if [ -n "$RUN_UPDATEDB" -a "$RUN_UPDATEDB" = "yes" -a \
-x /usr/bin/updatedb ] ; then
# avoid error messages from updatedb when using user nobody for find.
cd /
PARAMS="`test -n "$RUN_UPDATEDB_AS" && \
fgrep localuser /usr/bin/updatedb > /dev/null && \
echo --localuser=$RUN_UPDATEDB_AS`"
PARAMS="$PARAMS `test -n "$UPDATEDB_PRUNEPATHS" && \
echo --prunepaths=\'$(eval echo $UPDATEDB_PRUNEPATHS)\'`"
PARAMS="$PARAMS `test -n "$UPDATEDB_NETUSER" && \
echo --netuser=$UPDATEDB_NETUSER`"
PARAMS="$PARAMS `test -n "$UPDATEDB_NETPATHS" && \
echo --netpaths=\'$(eval echo $UPDATEDB_NETPATHS)\'`"
PARAMS="$PARAMS `test -n "$UPDATEDB_PRUNEFS" && \
echo --prunefs=\'$(eval echo $UPDATEDB_PRUNEFS)\'`"
eval nice -n 19 ionice -c 3 /usr/bin/updatedb $PARAMS 2> /dev/null
fi
exit 0
My question was: What syntax do I use for /etc/cron.daily.local/suse.de-updatedb ... if that is the correct name to use...
@jschiwal Thanks, that is a good workaround as it looks. But I'd still like to understand what the SuSE-team really meant I should put into /etc/cron.daily or below that.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Original Poster
Rep:
Update
Quote:
Originally Posted by JZL240I-U
...
I'd still like to understand what the SuSE-team really meant I should put into /etc/cron.daily or below that.
That still stands.
As of SuSE 11.2 /etc/sysconfig/locate is used to load these variables (UPDATEDB_PRUNEFS and UPDATEDB_PRUNEPATHS) using the normal syntax as already mentioned by unSpawn. I can at least reach the functionality that way but no understanding of the old ways .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.