Shirt Pocket Discussions  
    Home netTunes launchTunes SuperDuper! Buy Now Support Discussions About Shirt Pocket    

Go Back   Shirt Pocket Discussions > SuperDuper! > General

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-14-2006, 09:49 AM
minckster minckster is offline
Registered User
 
Join Date: Apr 2006
Posts: 18
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
Reply With Quote
  #2  
Old 08-14-2006, 05:32 PM
minckster minckster is offline
Registered User
 
Join Date: Apr 2006
Posts: 18
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/
It doesn't make any difference.

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.
Reply With Quote
  #3  
Old 08-14-2006, 06:47 PM
dnanian's Avatar
dnanian dnanian is offline
Administrator
 
Join Date: Apr 2001
Location: Weston, MA
Posts: 14,923
Send a message via AIM to dnanian
Are you trying to prevent multiple entries in Open With? Because that's not done with locate... it's done with LaunchServices.
__________________
--Dave Nanian
Reply With Quote
  #4  
Old 08-14-2006, 06:55 PM
minckster minckster is offline
Registered User
 
Join Date: Apr 2006
Posts: 18
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
Now I just have to figure out how to write the shell function in .bashrc so it sticks.
Reply With Quote
  #5  
Old 08-14-2006, 07:00 PM
dnanian's Avatar
dnanian dnanian is offline
Administrator
 
Join Date: Apr 2001
Location: Weston, MA
Posts: 14,923
Send a message via AIM to dnanian
Just wanted to make sure...
__________________
--Dave Nanian
Reply With Quote
  #6  
Old 08-14-2006, 07:38 PM
minckster minckster is offline
Registered User
 
Join Date: Apr 2006
Posts: 18
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***"; }
Of course the 'echo' part isn't required. I want it there in case something goes wrong with my custom 'locate,' so I won't forget that I had customized it.

I'm not quite sure if it should be '$1', '$*' or '$@'. '$1' seemed safest.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off

Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 10:14 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2024, vBulletin Solutions, Inc.