I want to use updatedb to index an external hard disk drive. I mount the drive under /media/external and removed '/media' from the PRUNEPATHS in /etc/updatedb.conf file.
This works and I can search for files when the drive is not connected using slocate. However it takes sometime to index the drive and I do not want updatedb to run on its own (if it ran while external is disconnected well...) and seeing as the box in question is on 24/7 if it should run by itself it will most certainly ruin the slocate db.
I was thinking of plugging the drive in and running updatedb again, once completed will this work
Code:
# slocate '/media/external' > ext_file_list
and then to find a file even when external is disconnected
Code:
grep file_i_want ~/ext_file_list
Or does any of the sages out there have a much better approach I should think of using?
Eagerly awaiting responses