Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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....
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.
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...
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.
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088
Rep:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.