crond- Unix, Linux Command


Previous Page
Next Page  


crond daemon to execute scheduled commands


cron [-n | -p | -s | -m]
cron -x [ext,sch,proc,pars,load,misc,test,bit]


crond-Cron should be started from /etc/rc.d/init.d or /etc/init.d Cron searches /var/spool/cron for crontab files which are named after accounts in crontabs found are loaded into memory. Cron also searches for /etc/crontab and the files in the directory, which are in a different format (see crontab(5) ). Cron then wakes up every minute, examining all stored crontabs, checking each command to see if it should be run in the current minute. When executing commands, any output is mailed to the owner of the crontab (or to the user named in the MAILTO environment variable in the crontab, if such exists). Additionally, cron checks each minute to see if its spool directory’s modtime (or the modtime on /etc/crontab) has changed, and if it has, cron will then examine the modtime on all crontabs and reload those which have changed. Thus cron need not be restarted whenever a crontab file is modified. Note that the crontab(1) command updates the modtime of the spool directory whenever it changes a crontab.

Daylight Saving Time and other time changesLocal time changes of less than three hours, such as those caused by the start or end of Daylight Saving Time, are handled specially. This only applies to jobs that run at a specific time and jobs that are run with a granularity greater than one hour. Jobs that run more frequently are scheduled normally. If time has moved forward, those jobs that would have run in the interval that has been skipped will be run immediately. Conversely, if time has moved backward, care is taken to avoid running jobs twice. Time changes of more than 3 hours are considered to be corrections to the clock or timezone, and the new time is used immediately.

PAM Access ControlOn Red Hat systems, crond now supports access control with PAM - see pam(8) . A PAM configuration file for crond is installed in /etc/pam.d/crond. crond loads the PAM environment from the pam_env module, but these can be overriden by settings in the crontab file.


Tag Description
-s This option will direct cron to send job output to the system log using syslog. This is useful if your system has no sendmail, or if mail is disabled using -m off.
-m This option allows you to specify a shell command string to use for sending cron mail output instead of sendmail(8). This command must accept a fully formatted mail message (with headers) on stdin and send it as a mail message to the recipients specified in the mail headers.
-n This option changes default behavior causing it to run crond in the foreground. This can be useful when starting it out of init.
-p Cron permit any crontab, which user set.
-x With this option is possible to set debug flags.



Start cron service

# /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


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 


Restart cron service

 # /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

Previous Page
Next Page