![]() |
|||||||||||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
|
#1
|
|||
|
|||
How to stop updatedb from indexing backup drive?
Has anyone figured out how to stop locate.updatedb from indexing one's backup drive? Currently /usr/bin/locate doubles its results, once from Macintosh HD and once from Backup HD. I already have Backup HD blocked from indexing by Spotlight, but that doesn't seem to affect locate.
A quick search gives this MacOSXhint, "Prevent locate's update from updating certain folders," but that refers to locate.updatedb running as a cron job, which it no longer does, so I'm reluctant to apply the hint. It also looks muy complicated. ![]() If no one can help me out, I'll post whatever answer I come up with -- eventually. Last edited by minckster; 08-14-2006 at 09:51 AM. Reason: Added comma to second paragraph |
#2
|
|||
|
|||
OK. It looks like locate.updatedb isn't fully implemented in OSX. It doesn't pay attention to options about excluding paths from indexing.
Here's another MacOShint that's more on target: Make the locate command ignore certain directories. What I tried first is Code:
$ sudo /usr/libexec/locate.updatedb ---prunepaths=/Volumes/Backup\ HD/ I then found a thread on MacOSX.com suggesting that OSX doesn't pay attention to prunepaths, locate.updatedb's options not working. (Scroll down to cilly's post.) I'm left with editing Apple's locate.updatedb script, which I'm not willing to do, or living with long results from locate queries. There is another possibility: Does anyone know what the alias would look like (in my .bashrc) to redefine 'locate' to filter out /Volume/Backup\ HD? Something with grep?I suppose I could also backup to a sparseimage in Backup HD. |
#3
|
||||
|
||||
Are you trying to prevent multiple entries in Open With? Because that's not done with locate... it's done with LaunchServices.
__________________
--Dave Nanian |
#4
|
|||
|
|||
No, I'm trying to prevent the shell command 'locate' from returning two entries for every match, one from Macintosh HD and another from Backup HD. It's really a MacOSX or Unix question. Its relation to SuperDuper! is that the only reason I have backup drive is because of your excellent program.
I've figured out the command sequence to filter out the results in the backup drive Code:
locate SOMESTRING | grep -vw \/Volumes\/Backup\ HD |
#5
|
||||
|
||||
Just wanted to make sure...
__________________
--Dave Nanian |
#6
|
|||
|
|||
Whew! Here's the line to add to .bashrc to redefine 'locate' so it excludes everything on the backup drive:
Code:
# Exclude the backup drive from locate's results function locate() { command locate $1 | grep -vw \/Volumes\/Backup\ HD; echo " ***REM: I redefined locate to exclude Backup HD***"; } I'm not quite sure if it should be '$1', '$*' or '$@'. '$1' seemed safest. |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | Rate This Thread |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Long Hang While Copying | BackerUpper | General | 4 | 06-12-2006 08:26 AM |
Hard drive size needed for backup? | Hoosier_1701 | General | 8 | 05-20-2006 07:49 AM |
How to verify a Scheduled Backup? | tuqqer | General | 3 | 12-06-2005 06:50 PM |
automatic initiation of backup when I plugin/mount my external Firefox drive? | mykmelez | General | 3 | 07-11-2005 03:00 PM |
Laptop freezes buring backup | kaalm | General | 5 | 05-12-2005 04:15 PM |