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
/etc/cron.daily/mlocate
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?
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.