≡ Menu

Linux Start Restart and Stop The Cron or Crond Service

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

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.
Linux Start Restart and Stop The Cron or Crond Service

Tutorial details
DifficultyEasy (rss)
Root privilegesYes
RequirementsNone
Estimated completion time1m

Commands for RHEL/Fedora/CentOS/Scientific Linux user

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

Task: Start cron service

To start the cron service, use:
# /etc/init.d/crond start
OR RHEL/CentOS 5.x/6.x user:
# service crond start
OR RHEL/Centos Linux 7.x user:
# systemctl start crond.service

Task: Stop cron service

To stop the cron service, use:
# /etc/init.d/crond stop
OR RHEL/CentOS 5.x/6.x user:
# service crond stop
OR RHEL/Centos Linux 7.x user:
# systemctl stop crond.service

Task: Restart cron service

To restart the cron service, use:
# /etc/init.d/crond restart
OR RHEL/CentOS 5.x/6.x user:
# service crond restart
OR RHEL/Centos Linux 7.x user:
# systemctl restart crond.service

Commands for Ubuntu/Mint/Debian based Linux distro

If you are using Debian or Ubuntu or Mint 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
OR
$ sudo service 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
OR
$ sudo service 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
OR
$ sudo service 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

Tweet itFacebook itGoogle+ itPDF itFound an error/typo on this page?

{ 19 comments… add one }

  • jeroen September 4, 2008, 11:12 pm

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

  • nixCraft September 5, 2008, 6:02 am

    jeroen,

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

    • Martin April 7, 2015, 6:20 pm

      # /etc/init.d/crond status

  • hari September 24, 2008, 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?

  • santosh December 17, 2008, 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

    • Julio Ceballos May 19, 2014, 1:04 pm

      There are some ways to do it and they depend on your linux distro
      This is an easy example of how the cron should look
      */10 * * * * /bin/curl (your localhost web adress for cron.php e.g.http://localhost/cron.php)

    • Michael Sole October 28, 2014, 7:55 pm

      Cron runs in a santized environment so always use full paths to run scripts:
      */10 * * * * /usr/bin/php /var/www/html/cron.php

  • Albert March 12, 2009, 3:53 pm

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

  • Anthony March 30, 2009, 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?

  • lizz April 16, 2009, 9:21 am

    thanks! worked out nicely

  • Abhishek June 24, 2009, 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

  • shailesh March 31, 2010, 5:57 am

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

  • Hawk July 30, 2010, 9:13 pm

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

    • Terri Ann January 5, 2011, 3:20 pm

      I also use

      sudo service cron [restart|start|stop]
  • otmoroz095 February 1, 2012, 7:11 am

    Thank you from Russia! =)

  • Helen Neely July 4, 2012, 8:08 am

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

  • Vlad October 1, 2012, 2:34 pm

    I found the best to be: sudo service cron restart

  • jon g October 31, 2012, 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.

  • hepha August 18, 2014, 2:05 pm

    http://serverfault.com/a/532121

    As crontab don’t do the job, you’ll to manipulate it’s content :

    crontab -l | grep -v ‘^#’ | cut -f 6- -d ‘ ‘ | while read CMD; do eval $CMD; done

    What it does :

    lists crontab jobs
    remove comment lines
    remove the crontab configuration
    then launch them one by one

Leave a Comment