Quickly search index of all files on nas?

Knowltey

Patron
Joined
Jul 21, 2013
Messages
430
Yes, I've read what you want, but the point still stands that things that you think would be harmless sometimes cause wildly unexpected side effects.

That said if you understand the risks then feel free.
 

diskdiddler

Wizard
Joined
Jul 9, 2014
Messages
2,377
I feel very free, does anyone have advice how I can set the file to remember changes after reboot? I figure it's going to be configured in a jail somehow?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Have you actually read what I'm proposing to change, or are you just deciding to make a snap, steadfast decision just to feel better about weighing in on a topic? There's consistently a staunch attitude of "this way or the highway" on the forums and frankly, it's tiring.

And do you know why we give that advice despite it being tiring? Because it's the way FreeNAS was designed. PERIOD. It doesn't matter if you don't like it, that's the god honest truth.


This is what I believe to be a cron job, that's (to my knowledge) enabled as per standard on most linux builds. I'm willing to take the risk or running a feature which has been in for I'd say at least a decade.

Well then... welcome to FreeBSD, where FreeBSD ≠ Linux.
 

diskdiddler

Wizard
Joined
Jul 9, 2014
Messages
2,377
And do you know why we give that advice despite it being tiring? Because it's the way FreeNAS was designed. PERIOD. It doesn't matter if you don't like it, that's the god honest truth.

Speaking of people who make paranoid posts as if every end user on the forum is running a 75TB production cluster for a medium sized business :)
Same person who insisted it must be my microservers CPU causing me 20mb/s writes, that's normal because I'm not using $4000 of hardware.......

I know you're trying to be careful and give the right advice here but ..... you know let's try to be realistic with our responses here.


Well then... welcome to FreeBSD, where FreeBSD ≠ Linux.

Very true! Can't deny that.
However it doesn't change the fact that locate / updatedb is included in FreeBSD - doesn't negate my point at all.
Infact I know it doesn't screw things up because I've enabled it on my server for several weeks, it works fine, it just gets lost on a reboot...... hence me wanting to hard set the single line change to keep it running.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
You just don't like the answers... but good luck! I can see people jumping through hoops with answers for your questions!
 

diskdiddler

Wizard
Joined
Jul 9, 2014
Messages
2,377
I don't like the answers cyberjock because you're consistently excessively paranoid. I know you're trying to help, I know you run far bigger systems than I do. There's being careful and then there's outright paranoia.

This is an end user system with 6 disks. I get where you're coming from but it's just excessive. So no, I don't like the answers and I'm sure it's possible to do.
 

Knowltey

Patron
Joined
Jul 21, 2013
Messages
430
Infact I know it doesn't screw things up because I've enabled it on my server for several weeks, it works fine, it just gets lost on a reboot...... hence me wanting to hard set the single line change to keep it running.

Then go and do it already! Why are you sitting here moping around and caring what we think if you've already tested the setting and are fine with the results?
 

diskdiddler

Wizard
Joined
Jul 9, 2014
Messages
2,377
Then go and do it already! Why are you sitting here moping around and caring what we think if you've already tested the setting and are fine with the results?

You really haven't actually read what I'm asking for, have you? .... Seriously? Are you just replying for the sake of it, or do you actually know what I'd like a hand with?
 

Knowltey

Patron
Joined
Jul 21, 2013
Messages
430
You really haven't actually read what I'm asking for, have you? .... Seriously? Are you just replying for the sake of it, or do you actually know what I'd like a hand with?

Yeah, you want to run locate and updatedb on a weekly basis. Just set up a cronjob to do whatever you need it to do at whatever times, I'm failing to see the issue here? If you want this to be an option in FreeNAS than make a feature request, otherwise you'll just have to set it up to do so manually.
 

diskdiddler

Wizard
Joined
Jul 9, 2014
Messages
2,377
Yeah, you want to run locate and updatedb on a weekly basis. Just set up a cronjob to do whatever you need it to do at whatever times, I'm failing to see the issue here? If you want this to be an option in FreeNAS than make a feature request, otherwise you'll just have to set it up to do so manually.

Ok good, I know how to make it work weekly.
I don't want a fundamental change by the developers for this, I get that most people don't care.
All I want is me not having to edit a file on reboot, so it does this as per normal.

It literally is as simple as this.
Edit /etc/periodic.conf and set weekly_locate_enable="YES" (the last line in the file). This will schedule weekly update of the locate database. After you do the edit you can also trigger immediate update of the database by running /etc/periodic/weekly/310.locate
Just not to be discarded at reboot.
 

Knowltey

Patron
Joined
Jul 21, 2013
Messages
430
Ok good, I know how to make it work weekly.
I don't want a fundamental change by the developers for this, I get that most people don't care.
All I want is me not having to edit a file on reboot, so it does this as per normal.

It literally is as simple as this.

Just not to be discarded at reboot.


Yeah, put the commands in a cronjob: http://doc.freenas.org/index.php/Cron_Jobs

Those don't get reset at reboot as far as I'm aware. Basically you're just taking what that weekly_locate-enable option does and doing it manually instead.

I'm not familiar enough with the commands in question or the cronjob configuration in particualr to give you instructions as to HOW, but in theory sticking the needed commands as crons at the desired times should resolve your dilemna of wanting a certain command to be run on a weekly basis at a certain time as that is the entire point of cron.
 

davidheat

Cadet
Joined
Feb 5, 2015
Messages
1
~# /usr/libexec/locate.updatedb
>>> WARNING
>>> Executing updatedb as root. This WILL reveal all filenames
>>> on your machine to all login users, which is a security risk.

just a little reverse engineering using the periodic.conf
 

esamett

Patron
Joined
May 28, 2011
Messages
345
I can confirm that the Freeware Locate32 works very well to index all my NAS files. The index files are quite small, <30MB for 20TB of files and the find function is crazy fast, comparing with horrible Windows Search. Keeping the database file on the NAS would slow things down a bit but probably not critically. :)

One potential Glitch: My Vista/32 box required a .dll file in the search32 folder to work. Windows 7/64 did not. The error message tells you which one. It is part of Visual C package. I just installed the .dll (GFGI) because I couldn't figure out if the C++ package would work or if I needed to find the C package - which I couldn't. (Microsoft o_O)

Good luck.
 

diskdiddler

Wizard
Joined
Jul 9, 2014
Messages
2,377
Yes, I use locate32 on my Windows PC's - it's not a bad piece of code, albeit now abandoned :/
Regardless a definitive solution under FreeNAS would be nice.
 

diskdiddler

Wizard
Joined
Jul 9, 2014
Messages
2,377
find . -name '*.cue'

This is a critical post, I wish I could etch it into my brain, the difficulty I have navigating the OS at times and specifically the updatedb / locate not working means this is my only means of finding stuff at times.
 

Alvin

Explorer
Joined
Aug 12, 2013
Messages
65
This would be a nice feature request, no? Add a checkbox to let FreeNAS update a daily/weekly locate database on the system dataset.
 

diskdiddler

Wizard
Joined
Jul 9, 2014
Messages
2,377
This would be a nice feature request, no? Add a checkbox to let FreeNAS update a daily/weekly locate database on the system dataset.

For a change (poking with stick, intensely .....) I think Cyberjock and crew might have a good reason to be paranoid this time.
The updatedb thing does indeed, IIRC thrash the USB stick or some such when updating the database? Potentially reducing the life of it as a boot device.

Also IIRC FreeNAS has some kind of 'no write' mode generally enabled for the USB? something like that.
I tried getting it all working manually through a few cron jobs and ultimately failed so I left it. I'm not a BSD guy or a linux guy but I really did like updatedb / locate on any linux machines I worked on.

Who knows if there's a way to get it going, I imagine it's a low priority but I'd love to see it work.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
This would be a nice feature request, no? Add a checkbox to let FreeNAS update a daily/weekly locate database on the system dataset.

It was already rejected before. But its trivial to setup with a cronjob in the WebGUI for those interested. I've seen some servers that are so big that they can't do an update to the database in less than 3 hours. So while it might "sound great" you have to consider the consequences when you scale up to massive scales (which is *exactly* what ZFS was designed for). ZFS really was designed for massively large servers. It doesn't scale down to "home user" size as well, which is where most of us hang out.
 

diskdiddler

Wizard
Joined
Jul 9, 2014
Messages
2,377
It was already rejected before. But its trivial to setup with a cronjob in the WebGUI for those interested. I've seen some servers that are so big that they can't do an update to the database in less than 3 hours. So while it might "sound great" you have to consider the consequences when you scale up to massive scales (which is *exactly* what ZFS was designed for). ZFS really was designed for massively large servers. It doesn't scale down to "home user" size as well, which is where most of us hang out.


Is there documentation on how to enable it or even just a post? Maybe I followed the doco incorrectly or something.
As for scaling up and down, that kind of doesn't make that much sense? Many of us are using it in home environments with anything from 2 to 20 disks? Maybe it's got some amazing features which are best demonstrated on a monster business installation but assuming you've got the CPU, memory for the thing at home, I don't see why having those big unwanted features and not using them is a bad thing?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Wanting them isn't a bad thing. But that doesn't mean you will get them. ;) For example, plenty have tried to argue that FreeNAS needs to work with less RAM and older hardware. Those are summarily rejected because it's really not worth the development resources because TrueNAS (and FreeNAS certified hardware) always has MUCH more than 8GB of RAM. FreeNAS exists because of TrueNAS. So if there isn't some remote vested interested in the part of TrueNAS, it's hit-and-miss whether you'll get it. ;)

Here's how I did it: (The locate.updatedb will run as whatever you are logged in as. It will also only index files/folders that are accessible from that user)

# /usr/libexec/locate.updatedb
# locate searchphrase

You do have to run the /usr/libexec/locate.updatedb at regular intervals as the database doesn't update itself when files/folders are created/deleted. If you were using FreeBSD the default cronjob that exists but is disabled runs this weekly.

See why I don't see why you need a manual or guide? ;)
 
Top