Discussion:
updatedb : how to disable its (an)cron job ?
Vincent Trouilliez
2006-12-07 17:14:04 UTC
Permalink
Hi,

updatedb runs once a day, I think triggered by a (ana)cron job,
and I would love to disable it, as it always has the bad habit of
running when I am using the machine. I do use the "locate" command, but
so rarely, that suffering updatedb just isn't worth it.

I don't see any GUI in Gnome to manage scheduled jobs (might be an idea
for a Feisty+1 spec....), could someone explain to me how to
"properly" (ie not changing permissions ;-) disable updatedb's job ?

TIA...

--
Vince
ben darby
2006-12-07 21:42:01 UTC
Permalink
Post by Vincent Trouilliez
Hi,
updatedb runs once a day, I think triggered by a (ana)cron job,
and I would love to disable it, as it always has the bad habit of
running when I am using the machine. I do use the "locate" command, but
so rarely, that suffering updatedb just isn't worth it.
I don't see any GUI in Gnome to manage scheduled jobs (might be an idea
for a Feisty+1 spec....), could someone explain to me how to
"properly" (ie not changing permissions ;-) disable updatedb's job ?
im not sure what you mean by "properly" as i would consider changing the
permissions -x on /etc/cron.daily/slocate the easiest to implement and
reverse should you change your mind later. otherwise you could just comment
out the file or change it so the condition is never true + then it wont
execute the update, maybe move it to weekly or monthly?
--
ben darby
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20061208/a5ef16da/attachment.pgp>
Vincent Trouilliez
2006-12-07 22:03:51 UTC
Permalink
Post by ben darby
im not sure what you mean by "properly" as i would consider changing the
permissions -x on
Hmm, I was thinking "proper" as in "remove the schedule job", just like
your remove/uninstall an application and not just remove its icon from
the menu ;-)
Post by ben darby
/etc/cron.daily/slocate the easiest to implement and
reverse should you change your mind later. otherwise you could just comment
out the file or change it so the condition is never true + then it wont
execute the update, maybe move it to weekly or monthly?
Ah, looks like you over-estimated my understanding of cron...thanks for
the starting point !
I need a beginners guide, an overview of how cron works, what files are
involved, how to remove a job, what commands and utility (if any) are
used to work with cron, etc, etc.
Also, cron is not enough. ISTR that updatedb nowadays on Ubuntu is
triggered by anacron, not cron. So, on top of cron, I need to have a
working knowledge of anacron as well, and what is the relation between
the two... if any.
It might be super simple for the one who knows, but until someone sheds
some light... it's just a black box to me and therefore I don't know
what is the proper way to remove a cron, and anacron, job.

I guess I could google for a howto, but since each distro has its
little differences, I would rather learn 100% relevant Edgy
instructions, rather than screw something up by following some Redhat or
Suse, or even an obsolete Ubuntu howto.


--
Vince
ben darby
2006-12-08 10:39:30 UTC
Permalink
Post by Vincent Trouilliez
Post by ben darby
im not sure what you mean by "properly" as i would consider changing the
permissions -x on
Hmm, I was thinking "proper" as in "remove the schedule job", just like
your remove/uninstall an application and not just remove its icon from
the menu ;-)
anacron uses run-parts to run all the executable scripts in relevant directories
whether it be daily, weekly, or monthly. along the same lines as the /etc/rcX.d
directories. so removing execution privileges from the file will remove it from
the schedule.
Post by Vincent Trouilliez
Ah, looks like you over-estimated my understanding of cron...thanks for
the starting point !
I need a beginners guide, an overview of how cron works, what files are
involved, how to remove a job, what commands and utility (if any) are
used to work with cron, etc, etc.
Also, cron is not enough. ISTR that updatedb nowadays on Ubuntu is
triggered by anacron, not cron. So, on top of cron, I need to have a
working knowledge of anacron as well, and what is the relation between
the two... if any.
i think your being confused by the naming scheme used, or the way that
cron is configured by default in ubuntu means cron wont execute those
directories if anacron is installed (see /etc/crontab)

cron will execute at a specific time, day, + interval if the computer isn't
running at that time the job will not execute until the next time that
combination comes around. therefore has its disadvantages on a desktop
machine that wont necessarily be available 24/7 and possibly never actually
be running when the jobs are scheduled. that's where anacron comes in...

anacron doesn't run at a specific time, but will ensure that its jobs are run
as close to the intervals specified as possible (IE. job specified to be run
daily but the machine is only active every second, it will just run the job
once every second day) and the jobs + frequencies are specified by their
location(daily, weekly, monthly) + presence of an executable script.

cron uses /etc/crontab + a crontab for any user that creates one in
/var/spool/cron/crontabs to edit/create a schedule for your user use
'crontab -e' for the file format 'man 5 crontab'

hopefully i've covered all your questions there.
--
ben darby
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20061208/23e30228/attachment.pgp>
Vincent Trouilliez
2006-12-08 11:36:07 UTC
Permalink
.......
hopefully i've covered all your questions there.
Ah, thanks for your time, I will read all that carefully and experiment...

--
Vince
Derek Broughton
2006-12-08 01:05:47 UTC
Permalink
Post by Vincent Trouilliez
updatedb runs once a day, I think triggered by a (ana)cron job,
and I would love to disable it, as it always has the bad habit of
running when I am using the machine. I do use the "locate" command, but
so rarely, that suffering updatedb just isn't worth it.
I don't see any GUI in Gnome to manage scheduled jobs (might be an idea
for a Feisty+1 spec....), could someone explain to me how to
"properly" (ie not changing permissions ;-) disable updatedb's job ?
It's in /etc/cron.daily/
--
derek
Thilo Six
2006-12-08 16:10:21 UTC
Permalink
Post by Vincent Trouilliez
Hi,
updatedb runs once a day, I think triggered by a (ana)cron job,
and I would love to disable it, as it always has the bad habit of
running when I am using the machine. I do use the "locate" command, but
so rarely, that suffering updatedb just isn't worth it.
I don't see any GUI in Gnome to manage scheduled jobs (might be an idea
for a Feisty+1 spec....), could someone explain to me how to
"properly" (ie not changing permissions ;-) disable updatedb's job ?
TIA...
Vince
cd /etc/cron.weekly/
sudo mv find.notslocate ../cron.weekly/
sudo mv slocate ../cron.weekly/

(or you could even move it to /etc/cron.monthly/ )

This way you do not loose all the functionalty off locate but it is less
disturbing. I use it this way.


bye Thilo
--
i am on Ubuntu 2.6 KDE
- some friend of mine

gpg key: 0x4A411E09
Thilo Six
2006-12-09 08:33:23 UTC
Permalink
Thilo Six wrote the following on 08.12.2006 17:10:

<snip>
Post by Thilo Six
cd /etc/cron.weekly/
err that should have been:

cd /etc/cron.daily/
Post by Thilo Six
sudo mv find.notslocate ../cron.weekly/
sudo mv slocate ../cron.weekly/
(or you could even move it to /etc/cron.monthly/ )
This way you do not loose all the functionalty off locate but it is less
disturbing. I use it this way.
bye Thilo
Florian Diesch
2006-12-08 12:42:49 UTC
Permalink
Post by Vincent Trouilliez
updatedb runs once a day, I think triggered by a (ana)cron job,
and I would love to disable it, as it always has the bad habit of
running when I am using the machine. I do use the "locate" command, but
so rarely, that suffering updatedb just isn't worth it.
I don't see any GUI in Gnome to manage scheduled jobs (might be an idea
for a Feisty+1 spec....), could someone explain to me how to
"properly" (ie not changing permissions ;-) disable updatedb's job ?
IMHO changing permissions of /etc/cron.daily/find.notslocate is the most
proper way.

Florian
--
<http://www.florian-diesch.de/>
Derek Broughton
2006-12-08 18:49:37 UTC
Permalink
Post by Florian Diesch
Post by Vincent Trouilliez
updatedb runs once a day, I think triggered by a (ana)cron job,
and I would love to disable it, as it always has the bad habit of
running when I am using the machine. I do use the "locate" command, but
so rarely, that suffering updatedb just isn't worth it.
I don't see any GUI in Gnome to manage scheduled jobs (might be an idea
for a Feisty+1 spec....), could someone explain to me how to
"properly" (ie not changing permissions ;-) disable updatedb's job ?
IMHO changing permissions of /etc/cron.daily/find.notslocate is the most
proper way.
It makes sense - if you remove it, it'll just get put back the next time you
upgrade the locate package.
--
derek
Florian Diesch
2006-12-11 16:24:25 UTC
Permalink
Post by Derek Broughton
Post by Florian Diesch
Post by Vincent Trouilliez
updatedb runs once a day, I think triggered by a (ana)cron job,
and I would love to disable it, as it always has the bad habit of
running when I am using the machine. I do use the "locate" command, but
so rarely, that suffering updatedb just isn't worth it.
I don't see any GUI in Gnome to manage scheduled jobs (might be an idea
for a Feisty+1 spec....), could someone explain to me how to
"properly" (ie not changing permissions ;-) disable updatedb's job ?
IMHO changing permissions of /etc/cron.daily/find.notslocate is the most
proper way.
It makes sense - if you remove it, it'll just get put back the next time you
upgrade the locate package.
And you can see that it's there but disabled, and it's easy to enabble
it again.


Florian
--
<http://www.florian-diesch.de/>
Loading...