Can updatedb keep localpaths for removable drives that aren't plugged in?
2
votes
1
answer
164
views
I run updatedb like this:
updatedb --localpaths="/a /b"
/a
is a removable drive. /b
is the local hard drive. Although /a
's not always accessible to me, I frequently want to run locate
to find if I have a certain file on it (based on the last time I ran updatedb
).
The problem is, if I run updatedb
when it's not plugged in, I get an error:
/usr/bin/find: '/a': No such file or directory
The database gets the latest information about /b
, but it removes /a
's existing data. Is there a way to keep /a
's data when /a
isn't plugged in during updatedb
?
I think this might be possible with multiple databases, one for /a
and another for /b
. Then a script can check whether or not /a
is plugged in when it decides whether or not to updatedb
.
But the man page for both commands kind of assumes I know a lot more than I do (e.g., what FINDOPTIONS
does), so I'm hoping there's an easier solution to this problem.
Asked by Daniel Kaplan
(1070 rep)
Sep 21, 2022, 12:09 AM
Last activity: Sep 21, 2022, 04:15 PM
Last activity: Sep 21, 2022, 04:15 PM