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
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop













{ 14 comments… read them below or add one }
hehe some of your headings show “corn” instead of “cron”….the same typo I have been making :)
jeroen,
Thanks for the heads up. The faq has been updated.
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?
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
There’s an “OPR” instead of “OR”.
Nice howto though, thanks!
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?
thanks! worked out nicely
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
use this :
# /etc/rc.d/init.d/crond start
This has been deprecated. New method is: sudo service cron start
I also use
Thank you from Russia! =)
Thanks for this simple tips, they worked nicely on my new Ubuntu installation.
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.