![]() |
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.
|
All times are GMT. The time now is 21:07. |
vBulletin® Version 3.8.8