Linux Start Restart and Stop The Cron or Crond Service

by on December 29, 2006 · 15 comments· LAST UPDATED March 12, 2009

in , ,

How do I start, restart and stop the cron service under Linux / UNIX / BSD like operating systems?

Cron (crond) daemon or service is use to execute scheduled commands or scripts. cron wakes up every minute, examining all stored crontabs, checking each command to see if it should be run in the current minute.

If you are using Redhat (RHEL)/Fedora Core/Cent OS Linux use the following commands.

Task: Start cron service

To start the cron service, use:
# /etc/init.d/crond start

Task: Stop cron service

To stop the cron service, use:
# /etc/init.d/crond stop

Task: Restart cron service

To restart the cron service, use:
# /etc/init.d/crond restart

If you are using Debian or Ubuntu Linux the following commands.

Task: Debian Start cron service

To start the cron service, use:
# /etc/init.d/cron start
OR
$ sudo /etc/init.d/cron start

Task: Debian Stop cron service

To stop the cron service, use:
# /etc/init.d/cron stop
OR
$ sudo /etc/init.d/cron stop

Task: Debian Restart cron service

To restart the cron service, use:
# /etc/init.d/cron restart
OR
$ sudo /etc/init.d/cron restart

Task : Start the cron service at boot time

It is recommended that you start the service at boot time so that job can run w/o problems.

If you are using Redhat (RHEL)/Fedora Core/Cent OS Linux use the following commands to ensure that the service remains enabled after a reboot:
# chkconfig crond on
You can use a text based GUI tool called ntsysv to enable crond service:
# ntsysv

If you are using Debian or Ubuntu Linux use the following commands to ensure that the service remains enabled after a reboot:
# rcconf
OR
$ sudo rcconf
You can use command line tool update-rc.d:
# update-rc.d cron defaults
OR
$ sudo update-rc.d cron defaults

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 15 comments… read them below or add one }

1 jeroen September 4, 2008 at 11:12 pm

hehe some of your headings show “corn” instead of “cron”….the same typo I have been making :)

Reply

2 nixCraft September 5, 2008 at 6:02 am

jeroen,

Thanks for the heads up. The faq has been updated.

Reply

3 hari September 24, 2008 at 9:35 am

Hi,
i need to set classpath env variable for the scripts run by cron. i tried using bashrc, but it didnt work.. can anyone help me in this?

Reply

4 santosh December 17, 2008 at 4:26 pm

hello,
i have cron.php file and i want run this script in every 10 minut . my file directory structure is /var/www/html/.
so any one help me

Reply

5 Albert March 12, 2009 at 3:53 pm

There’s an “OPR” instead of “OR”.
Nice howto though, thanks!

Reply

6 Anthony March 30, 2009 at 6:48 am

got a mail server setup using Fedora Core 2. A power outage occured which unfortunately the UPS didnt hold. errors generated when start up;
***An error occured during the file system check. Dropping you to a shell; the system wll reboot when you leave the shell. Give root password for maintanance (or type Control -D to continue)

After rebooting this is what happened;

setting up Logical Volume Management: /dev/hdc: open failed: No medium found (FAILED)

Can you point me in the right direction please?

Reply

7 lizz April 16, 2009 at 9:21 am

thanks! worked out nicely

Reply

8 Abhishek June 24, 2009 at 9:07 am

I think you corrupted your / partition ,try to run e2fsck command if this doesnt work ,use linux rescue and check all entries in /etc/fstab and verify whether it is correct

Reply

9 shailesh March 31, 2010 at 5:57 am

use this :
# /etc/rc.d/init.d/crond start

Reply

10 Hawk July 30, 2010 at 9:13 pm

This has been deprecated. New method is: sudo service cron start

Reply

11 Terri Ann January 5, 2011 at 3:20 pm

I also use

sudo service cron [restart|start|stop]

Reply

12 otmoroz095 February 1, 2012 at 7:11 am

Thank you from Russia! =)

Reply

13 Helen Neely July 4, 2012 at 8:08 am

Thanks for this simple tips, they worked nicely on my new Ubuntu installation.

Reply

14 Vlad October 1, 2012 at 2:34 pm

I found the best to be: sudo service cron restart

Reply

15 jon g October 31, 2012 at 2:59 pm

Im so glad i read the comments!!!!!!!

MUST USE:
sudo service cron [restart|start|stop]

Why not update this page or at least state that its old version!!! wasted hours with old cron and crond …. happy now though.

Reply

Leave a Comment

Tagged as: , , , , , , , , , , , , , , , , , , , , ,

Previous Faq:

Next Faq: