Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

How can I prevent cronjobs from automatically starting after my server has rebooted?

Every time I reboot my server the cronjobs start up again, which I'd like to prevent.

These servers are running Ubuntu 12.04 x32

share|improve this question
Why have cron jobs at all if you don't want them to run? (I probably don't understand your question.) – Mat Dec 24 '13 at 20:45
I still use them , but do not want them to start up until I say so (as is the case with server reboot). – d-_-b Dec 24 '13 at 20:49
Disable the cron daemon's startup script then? – Mat Dec 24 '13 at 20:50
Yep, that's why I have this question here! ... how is that done? – d-_-b Dec 24 '13 at 20:52

If memory serves, Ubuntu uses anacron, which by design runs cron jobs that were missed due to downtime, presumably to make cron jobs more reliable on laptops and other systems that are expected to be turned off more often than servers typically are.

If you don't wish this behavior, switch to another cron daemon that is not designed to run missed scheduled tasks.

share|improve this answer
Maybe you could explain to him how to disable this service as part of your answer? Try and be specific and show examples. – slm Dec 24 '13 at 21:48
I only known anacron from CentOS. Can`t you just configure anacron in Ubuntu so it behaves more like the classical cron? – Nils Dec 29 '13 at 22:04

I'm using a very hacky method:

Comment out all cronjob lines:

echo "$(crontab -l)" | sed -e "s/^/#/g" | crontab

Uncomment out all cronjob lines:

echo "$(crontab -l)" | sed -e "s/#//g" | crontab

This way, if I reboot, it's commented out for when the cronjobs start up again.

share|improve this answer

I hope this answer from Ask Ubuntu is still valid.

On CentOS cron has been removed in favour of anacron - but it works a little bit different there. On Ubuntu:

It burns down to - imho - uninstall anacron. This will remove the anacron binary putting cron into "normal" mode without anacron kicking in.

share|improve this answer

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.