Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I see that Ubuntu uses /etc/cron.{daily,weekly,monthly} for cron jobs. I also see that some things, like updatedb from mlocate, put their jobs there:

$ dpkg -L mlocate|grep y/m

Somtetimes, I would like to disable some of these jobs (mlocate in this case). I can obviously sudo mv /etc/cron.daily/mlocate ~/cron.daily-dont-run and be over with it. However, two questions:

  • Is this how this gets managed? Is there something like service to manage SysV init scripts or overrides such as described in Upstart intro, 10.41.1 Override Files? I would like to tell it "OK, I don't want you to start", but without touching what is installed (see next item for one of the reasons)
  • If I delete and then reinstall mlocate, I'll again get the cron.daily entry. Also, I guess (is this true?) upgrades will probably not go smoothly (e.g. it will make a cron.daily entry or maybe possibly break the package if there's something in the cron entry that it depends on).

If you do, how do you manage / deal with the things such as the above?

share|improve this question

One way to do it is to chmod -x /usr/bin/updatedb.mlocate . The cron script checks for the +x bit and will exit if it's not executable. Should be less intrusive than messing with the cron files, with the caveat that running updatedb.mlocate manually will be more complicated.

share|improve this answer
Copying the file elsewhere, then blanking the file should work. I don't know if this is true for cron jobs, but for config files, apt will present a diff of the two when updating. This should allow you to keep your blanked version (or not) without messing with the update process. – Huckle Mar 1 '12 at 5:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.