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

ADVERTISEMENTS

[donotprint]
Tutorial details
Difficulty Easy (rss)
Root privileges Yes
Requirements None
Time 1m
[/donotprint]

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

This entry is 4 of 16 in the Linux Cron Jobs Howto & Tutorial series. Keep reading the rest of the series:
  1. What is cron on a Linux or Unix-like systems?
  2. How To Add Jobs To cron Under Linux or UNIX?
  3. Verify crond Daemon And Cronjobs Are Running
  4. Start Restart and Stop The Cron or Crond Service
  5. List / Display All Cron Jobs
  6. Linux / UNIX Crontab File Location
  7. Change Crontab Email Settings ( MAILTO )
  8. Disable The Mail Alert By Crontab Command On a Linux or Unix-like Systems
  9. At What Time Cron Entries In cron.daily, cron.weekly, cron.monthly Run?
  10. Execute Cron Job After System Reboot
  11. Setup and Run PHP Script As A Cron Job
  12. Run crontab job every minute on a Linux or Unix-like system
  13. Running crontab (cron jobs) Every 10 Minutes
  14. Cron Job Script Execution on the Last Day of a Month
  15. Execute / Run crontab (cron jobs) every 1 minute
  16. Ubuntu create cron.log file
🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
21 comments… add one
  • jeroen Sep 4, 2008 @ 23:12

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

  • 🐧 nixCraft Sep 5, 2008 @ 6:02

    jeroen,

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

    • Martin Apr 7, 2015 @ 18:20

      # /etc/init.d/crond status

  • hari Sep 24, 2008 @ 9:35

    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 Dec 17, 2008 @ 16:26

    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 @ 13:04

      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 Oct 28, 2014 @ 19:55

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

  • Albert Mar 12, 2009 @ 15:53

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

  • Anthony Mar 30, 2009 @ 6:48

    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 Apr 16, 2009 @ 9:21

    thanks! worked out nicely

  • Abhishek Jun 24, 2009 @ 9:07

    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 Mar 31, 2010 @ 5:57

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

  • Hawk Jul 30, 2010 @ 21:13

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

    • Terri Ann Jan 5, 2011 @ 15:20

      I also use

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

    Thank you from Russia! =)

  • Helen Neely Jul 4, 2012 @ 8:08

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

  • Vlad Oct 1, 2012 @ 14:34

    I found the best to be: sudo service cron restart

  • jon g Oct 31, 2012 @ 14:59

    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 Aug 18, 2014 @ 14:05

    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

  • anderson Nov 25, 2015 @ 14:25

    Very helpful ;) thanks a lot.

  • mubeen Mohammed Feb 21, 2016 @ 6:25

    Below commands really resolved my issue of cron job
    o restart the cron service, use:
    # /etc/init.d/cron restart

    OR
    $ sudo /etc/init.d/cron restart

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.