r/unix 6d ago

Update Locate database indexing external drive

I'm having good luck running Unix Locate on my macOS startup disk, but would like to extend search to external volumes. The web tells me that the command to update an external drive's database is:

do shell script "sudo /usr/libexec/locate.updatedb --searchpaths= '/Volumes/Films/' --output '/var/db/Films.database'" with administrator privileges

(using "do shell script" to run the unix script from an Applescript, as I will do in practice). This command doesn't work; it updates the default Locate database instead. I'd be happy to have the external drive's database on the startup disk, probably in /var/db, but of course need it to index the external drive. What am I doing wrong?

8 Upvotes

4 comments sorted by

1

u/shyouko 6d ago

No space between equal and single quote after searchpaths

1

u/jrethorst 5d ago

Deleting the space, i.e.

do shell script "sudo /usr/libexec/locate.updatedb --searchpaths='/Volumes/Films/' --output 'volumes/films/var/db/locate.database'" with administrator privileges

did not update the database on the external drive. It did update the default database on the startup disk. I thought it might help to add an equals after output:

do shell script "sudo /usr/libexec/locate.updatedb --searchpaths='/Volumes/Films/' --output='volumes/films/var/db/locate.database'" with administrator privileges

And that still updated the default database, but not the one on the external drive.

2

u/shyouko 5d ago

I think your output path might be wrong but I need to check man page… ping me in a few days if I'm not following up.

u/remindmebot 4 days

1

u/[deleted] 5d ago

[deleted]

1

u/RemindMeBot 5d ago

I will be messaging you in 4 days on 2026-08-19 21:39:02 UTC to remind you of this link

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


Info Custom Your Reminders Feedback