![]() |
slocate
anyone know where to get a version of slocate that
will run on the n810 (os2008)? TIA, |
Re: slocate
I thought about porting it (slocate is very usefull yes) but slocate database needs to be frequently updated, through cron. There is no cron tasks by default (but cron system is there). I wonder if there is a reason (performance or anything related).. ?
|
Re: slocate
Quote:
Oh wait, I'm thinking like a slackware :eek:, or worse, a UNIX :eek::eek: man. This is debian, so slocate package must depend on cron, because you typically want to run it that way, and you can't have a package that requires the sysadmin to, you know, admin the sys... ;) I'd gladly take such a thing, if you could get it with no cron dep. It'd be useful to me if I updated the db once a month, because I'm usually hunting some system file, which don't change much. Though it occurs to me, the tablets need something like anacron, only power-supply aware. If the tablet's charging (and the battery's over, say, 30% full), and it's been over <24hrs | 1 week | 1 month> since the task was last run, then re-run it... Be a good project for me, when I get time :) |
Re: slocate
why not just run a script something like this:
while true do sleep 24 hrs if charging then updatedb done I usually leave my n810 plugged in over night, so if I start this script at the right time .... is there a problem with faking cron like this? anyway, I'd be happy to run slocate manually so I hope it gets ported (there is a version for the 770 it seems but it won't install on the n810 see: http://lucidvisions.com/#nes) |
Re: slocate
There is a simpler way.
create two scripts in /usr/bin called updatedb and locate updatedb Code:
find / -print > /medi/mmc2/locate.db Code:
grep "$1" /media/mmc2/locatedb | more Code:
crontab -e Code:
0 4 * * * /usr/bin/updatedb Code:
locate leafpad |
Re: slocate
Albright, that'd work for a while, but eventually the execution time of the rebuild makes drift out of sync, and then you could go weeks without an update.
A better thing is to check once an hour or so, so (assuming your plug-in at night is precisely periodic), it'd drift an hour, then get caught on the "previous" iteration. But then you do have to check when it was last run so you aren't running it 6 times a night. I assume that's what you were trying to dodge. Try: Code:
#!/bin/sh Rick, your Quote:
|
Re: slocate
Benson
It works and has been working for over a year. I use this regularly and find the '|more' extremely usefull. You can of course 'locate libcurl |more' its just more typing. Rick |
Re: slocate
Quote:
(In case you're as familiar with tools as with UNIX, you should know that large screwdrivers (14" and up, often smaller ones too) generally have a hexagonal section below the handle, so a wrench may be used when more torque is required to bust a stubborn screw loose.) It's like saying "Sometimes I need to use a wrench on my screwdriver, so I'll make a screwdriver with a big @#$%ing handle sticking out the side so I can use it that way!" |
Re: slocate
rcull's suggestion is not too bad, but I need more
help with the "crontab -e" command on my n810 :D |
Re: slocate
Not to belittle the merits of meaty tools ;) I for one would love slocate. As for cron, why not set it to oncce a week.
|
Re: slocate
Benson
1. If this was one of the UNIX servers I have managed for the last 15 years, yes you would be right but this is a personal tablet. I don't know about you, but I, haven't got the memory of a goldfish and tend to know what I've done from one day to the next so I'm pretty unlikely to use it in another script. 2. Both the script name and the '|more' are obviously optional. 3. I wonder which is the most '******ed' replacing an accurate (and available) time based tool (cron) with a script using 'sleep' or using accurate (and available) tools find and grep in a way they were meant to be used to replace something currently unavailable! Lastly, I pride myself on having manners something you are obviously Not Familiar with. Albright A useful header for crontab files Code:
############################################################################# Regards Rick |
Re: slocate
Thanks for the script rcull, I used it fine. I have a cron service running, and I chmodded the scripts and edited crontab with leafpad.
Although 2 unintended mistakes in scripts. Meia should be media and locatedb should be locate.db (or the other way around depending on which script you edit first |
Re: slocate
I must be pretty dense, but I can't find any
crontab command on my n810 and there doesn't seem to be any cron service available. (I *know* what cron is and the syntax - I just don't know how to install the cron service on my n810). |
Re: slocate
Search for cron on this forum, I found a attachment that installed cron (it doesn't come with the ITT by default).
BTW: Is there any vi for dummies? The only command I know is :wq :\ I had to use some own tricks & leafpad to edit cronttab. |
Re: slocate
thanks Faheem - found it
very basic vi: i - insert mode esc - exit insert mode ZZ - save & exit vi editing more less works as expected |
Re: slocate
Thanks for that :) vi was killing me lol.
|
Re: slocate
qwerty12
A very good vi reference card (pdf) http://limestone.truman.edu/~dbindner/mirror/vi-ref.pdf A nice tutorial http://http://www.eng.hawaii.edu/Tutor/vi.html regards Rick |
Re: slocate
Quote:
Quote:
Quote:
Quote:
|
Re: slocate
We now have
not grep ;p not locate not slocate but the great secure and fast Mlocate :D Quote:
Either you update the database : * Through cron (a daily task is installed) or * Manually by running updatedb (as root) mlocate will remap your "/usr/bin/locate" and "/usr/bin/updatedb" to point to mlocate binaries. It creates a new user/group for security reasons. You can do normal searches: PHP Code:
PHP Code:
|
Re: slocate
Wonderful tool. Really had it missing.
It was hard to find because findutils points to busybox. |
Re: slocate
I've put a packaged-up version of cron in my repository (see here), by the way. It's just the one from the forums put into a .deb file.
|
All times are GMT. The time now is 03:47. |
vBulletin® Version 3.8.8