Crontab service is used for scheduling of any automatic tasks to be happen.
Service name: crond
Config file: crontab
There are five columns in crontab
1st column : minutes ( 0 – 59 )
2nd column : hour ( 0 – 23 )
3rd column : date ( 1 -31 )
4th column : month ( 1- 12 )
5th column : days ( 0-6 )
#crontab [-u user] [-l | -r | -e] [-i] [-s]
-u It is name of the user who wants to get permission. If user is not specified then user who executing crontab will be consider
-l current crontab of the user will be displayed
-r Currently presented crontab will be removed
-e Edit the current crontab file by editor
-i This option modifies the -r option to prompt the user for
5 dollars! Sephora.
a ‘y/Y’ response before actually removing the crontab
-s It will append the current SELinux security context string as an MLS_LEVEL setting to the crontab file before editing / replacement occurs – see the documentation of MLS_LEVEL in crontab.
To search command:
To Schedule job once a day
10 08 *** /bin/echo “hello”
At 8:10 AM every day system will display message “hello”.
To schedule a job twice a day
10 08,10 *** /bin/echo “hello”
At 8:10 AM and 10.10AM every day system will display message “hello”.
To schedule a job once a year
0 12 13 3 * /bin/echo “happy birthday”
Every year March 13 12.00 AM system will display message “happy birthday”.
To schedule a job once a week
10 08 **1 /bin/echo “hello”
Every Monday 8:10 AM system will display message “hello”.
#service crond restart
#chkconfig crond on