Linux Start Restart and Stop The Cron or Crond Service

by Vivek Gite on December 29, 2006 · 12 comments

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

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

{ 12 comments… read them below or add one }

1 jeroen September 4, 2008

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

Reply

2 vivek September 5, 2008

jeroen,

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

Reply

3 hari September 24, 2008

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

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

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

Reply

6 Anthony March 30, 2009

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

thanks! worked out nicely

Reply

8 Abhishek June 24, 2009

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

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

Reply

10 Hawk July 30, 2010

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

Reply

11 Terri Ann January 5, 2011

I also use

sudo service cron [restart|start|stop]

Reply

12 otmoroz095 February 1, 2012

Thank you from Russia! =)

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">




Previous post:

Next post: