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.
|
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....
|
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. |
I split your post out of the original (close to two years old) thread.
Cheers, Tink |
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 |
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...
|
Actually just a
chmod a-x /etc/cron.daily/slocate.cron as root should do ... Cheers, Tink |
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.
|
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 :) |
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 |
Good idea. Thanks.
|
All times are GMT -5. The time now is 12:29 PM. |