LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   updating locate database only when disk activity low (https://www.linuxquestions.org/questions/linux-software-2/updating-locate-database-only-when-disk-activity-low-258520/)

beetlenaut 11-23-2004 05:18 PM

updating locate database only when disk activity low
 
Updating the slocate database slows the computer a lot (stupid IDE bus), so I'm looking for a way to do it only when the cpu load AND disk activity are low--basically, when I'm not trying to do anything else.

Cron really doesn't help because I use my computer at all kinds of weird times. I can't have it run at any set time without it getting in my way sometimes.

There must be some tool I don't know about, but I can't seem to come up with the right search terms. Thanks!

acid_kewpie 11-23-2004 06:26 PM

i'm not aware of a nicer way to do this, it may well exist, but google doesn't say so...

i'd say you could set a cron job to update every so often using a command like
Code:

if [ `uptime | cut -c 60,62-63` -le 10 ]; then nice -19 updatedb; fi
so if the load average on the last 5 minutes is less than 0.10 then run updatedb, with a nice value. you might also want to do an age check on thelocatedb file too. no need to update if it's less that 24 ours old etc...


All times are GMT -5. The time now is 05:52 PM.