LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   updatedb running too frequently (https://www.linuxquestions.org/questions/linux-newbie-8/updatedb-running-too-frequently-280197/)

lel800 01-20-2005 08:57 AM

It seems like updatedb runs more than once every 24 hours. And I know I just don't create many files on this computer in that space of time. So I would like to disable updatedb as a cron job and only run it manually when I need to. Is this possible and if so how? I appreciate any feedback.

student04 01-20-2005 09:48 AM

Personal (user) cron jobs can be found with the command "crontab -e". Check to see jobs type "crontab -l" (but if this is a root user specified command, it'll show up). If the system is causing this then it probably lies elsewhere....

lel800 01-20-2005 10:10 AM

Thanks for your reply.

In the shell I entered "crontab -e" and the output included "no crontab". Then in the shell I entered "crotab -l" and the result was similar "no crontab". So I guess this is a system level cron job. If anyone has any thoughts about how I can go about dissabling this root/system cron so that updatedb only runs when I manually execute "updatedb" in the shell I'd appreciate it. Thanks again.

Tinkster 01-20-2005 01:57 PM

I split your post out of the original (close to two years old) thread.


Cheers,
Tink

Genesee 01-20-2005 02:31 PM

individual crontabs should be somewhere in /var/spool/cron

also, there may be a /etc/crontab which usually just runs each of the scripts in /etc/cron.hourly, /etc/cron.daily, ... etc. at the specified times

so first check each of those locations for a script/command calling updatedb

lel800 01-20-2005 02:51 PM

Thanks for your response. I looked inside the directory "/etc/cron.daily" and I see a file "slocate.cron" and I think that might be it. Is it safe to switch to root user and delete this file.. Would that do the trick.. Is that the right file...

Tinkster 01-20-2005 03:34 PM

Actually just a
chmod a-x /etc/cron.daily/slocate.cron
as root should do ...


Cheers,
Tink

Genesee 01-20-2005 03:49 PM

that sounds likely - just read it with "cat" or "more" to see what it does. then make un-executable as Tinkster said, or you could move it, or delete it, etc.

lel800 01-20-2005 06:54 PM

I took a look at the file with vi and I could see that indeed it did run
updatedb with parameters and so forth, so I took the suggestion by Tinkster to
change the permissions on the file making it non executable. That seems like
it should work. And the advantage is it will be easy enough to change the
executable state back in case I wish updatedb to be resumed as a cron job.

So I'll say "Thanks" assuming it did work and if updatedb keeps
running I'll check back in and ask more questions.

Thanks :)

IBall 01-20-2005 08:06 PM

I know you said that you wanted to run updatedb manually, but perhaps you could move the updatedb.cron script to cron.weekly or cron.monthly. Then it would still run occasionally, and you would , of course, be able to run updatedb manually when you want.

--Ian

lel800 05-06-2005 04:28 PM

Good idea. Thanks.


All times are GMT -5. The time now is 12:29 PM.