|
|
Make the locate command ignore certain directories
Following your hint gives me this error output when I try to run the revised script:
Make the locate command ignore certain directories
Here's my code, by the way:
Make the locate command ignore certain directories
You know what's weird about the code is that you don't have a ! (not) operator in front of your regexs. Aren't you saying YES then to including /Volumes and /Previous Systems?
Make the locate command ignore certain directories
hmm, try escaping the "!" so it reads "\! fstype local" this may be a csh vs. tcsh thing?
Very bad hint
Modifying system files is never a good idea, especially since there is an option to be passed at the command line to skip certain directories: it is --prune-path, as in:
doh!
I stand corrected: Use the method Navajo mentions.
Very bad hint
Okay, so you don't think we should modify system files.... Then how do we pass the parameters you suggest? For example, the locate.updatedb command is run by the periodic weekly script. If we want to change which directories are parsed, then we would have to modify THAT system file.
Very bad hint
Modifying a cron job is much safer than modifying system files or doing crazy things like I did once, where I compiled my own version of tcsh on my work solaris server once and set it up to use that spanky-fine tcsh as the default shell for all users (including root). Clever me, no?
Very bad hint
Does anyone else ever see the "The locate db is over 8 days old" msg when using locate. I like to use locate - but it seems the db is not being updated. I leave my machine on 24/7 so I know the crontasks are running - but it always says "over 8 days old"
Very bad hint
I guess you did an upgrade install? :-)
Very bad hint
Sure it's your system and you do what you want. If you want to modify scripts, it is your right to do so. I just wouldn't do it if not necessary. And there is a significant difference between modifying system configuration files in /etc versus scripts in /usr/bin and others. For instance, there are hooks to do daily and weekly jobs that are already provided: create daily.local or weekly.local to add you own stuff to the cron job.
Re: Very bad hint
I see --prunepaths in the man page, but are you sure that it actually works? Looking at the source for locate.updatedb, I don't see it processing any command line arguments. I think the man page must be out of sync for some reason. (I'm using Panther.)
Make the locate command ignore certain directories
Okay, so the code has to look like this ( The \! has to go before the parentheses). |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.05 seconds |
|