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
- Email FAQ to a friend
- Printable version
- Rss Feed
- Last Updated: 3-12-09

{ 8 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