LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 02-01-2010, 06:54 AM   #1
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
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.
 
Old 02-02-2010, 04:10 PM   #2
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
You pretty much have two directives you might use--

PRUNEFS - which excludes file systems
(usually you don't want say remote file systems or cdroms.)

or

PRUNEPATH - which excludes specific paths in the file system
(usually you don't want /dev or /tmp or /proc for example.)

Unless you have an issue with something being no caught you feel should or wish to exclude a location you shouldn't need to heavily modify the file.
 
Old 02-02-2010, 04:16 PM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
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.
 
Old 02-03-2010, 08:06 AM   #4
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rweaver View Post
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 View Post
...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...

Last edited by JZL240I-U; 02-03-2010 at 08:07 AM.
 
Old 02-03-2010, 08:10 AM   #5
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by unSpawn View Post
...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' ...
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...
 
Old 02-03-2010, 10:29 AM   #6
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
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
 
Old 02-03-2010, 10:38 AM   #7
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Original Poster
Rep: Reputation: Disabled
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.
 
Old 02-03-2010, 11:03 AM   #8
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
In the end the variables and things returned from the executions are just evaluating out to either paths or file systems though.
 
Old 02-03-2010, 11:22 AM   #9
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
In SuSE, you can add these entries in /etc/sysconfig/locate. This file is sourced, defining the variables you mentioned.

You can do so easily using YaST2's /etc/sysconfig editor.
 
Old 02-09-2010, 09:25 AM   #10
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Original Poster
Rep: Reputation: Disabled
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.

Last edited by JZL240I-U; 02-09-2010 at 09:30 AM.
 
Old 09-24-2010, 06:48 AM   #11
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Original Poster
Rep: Reputation: Disabled
Update

Quote:
Originally Posted by JZL240I-U View Post
...
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 .
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Declare Vs Define Ace Blackwell Programming 15 09-14-2008 08:23 PM
updatedb crashes: src/updatedb.c:730: scan_cwd: Assertion `name_size > 1' failed sumanc Fedora 3 07-11-2008 04:39 PM
why C has two ways to declare structs? angustia Programming 5 04-15-2006 10:36 PM
declaration does not declare anything tristanm Programming 5 10-24-2005 04:00 PM
What's the difference between 'updatedb' and 'updatedb&' ?? DreameR-X Linux - Newbie 4 12-18-2004 04:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 01:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration