Add to boot automatic start: chkconfig -- level35crondon1, crontab command function description: Set a timer. Syntax: crontab [-u & lt; user name & gt;] [configuration file] or crontab [-u & lt; user name & gt;] [-elr] parameters: -e: Edit the timer settings of the user. -L list the timer settings of this user.
Add boot auto start:
Chkconfig -- level 35 crond on
1. crontab command
Function description: sets a timer.
Syntax: crontab [-u <用户名称> ] [Configuration file] or crontab [-u <用户名称> ] [-Elr]
Parameters:
-E: Edit the timer settings of the user.
-L list the timer settings of this user.
-R: delete the timer settings of this user.
-U <用户名称> Specifies the user name to set the timer.
2. crontab format
Basic format:
* *** Command
Hour, day, month, and Week commands
The 1st column indicates minute 1 ~ 59. each minute is represented by * or */1.
The first column indicates the hour 1 ~ 23 (0 indicates 0 points)
The 3rd column indicates the date 1 ~ 31
The 4th column indicates the month 1 ~ 12
The identification number of column 5th is from day of the week to day ~ 6 (0 indicates Sunday)
6th columns of commands to run
Some examples of crontab files:
30 21 ***/usr/local/etc/rc. d/lighttpd restart
The preceding example indicates restarting apache at every night.
45 4, 10, 22 **/usr/local/etc/rc. d/lighttpd restart
The preceding example indicates that apache is restarted at on the 1st, 10th, and 22th every month.
10 1 ** 6, 0/usr/local/etc/rc. d/lighttpd restart
The preceding example indicates that apache is restarted at every Saturday and Sunday.
0, 30 18-23 ***/usr/local/etc/rc. d/lighttpd restart
The preceding example indicates that apache is restarted every 30 minutes between and every day.
0 23 ** 6/usr/local/etc/rc. d/lighttpd restart
The preceding example indicates that apache is restarted at every Saturday.
0 ***/usr/local/etc/rc. d/lighttpd restart
Restart apache every hour
* 23-7/1 ***/usr/local/etc/rc. d/lighttpd restart
Restart apache every hour between PM and PM.
0 11 4 * mon-wed/usr/local/etc/rc. d/lighttpd restart
Restart apache on November 4 and every Monday to Wednesday.
0 4 1 jan */usr/local/etc/rc. d/lighttpd restart
Restart apache at on January 1, January 1
*/30 */usr/sbin/ntpdate 210.72.145.44
Synchronization time every half hour