Crontab (the full Name Cron Table Schedule Task List) is a tool that is used for periodic execution.
Related directives:
Usage
crontab [-u user] File
crontab [- u user ] [-i] {-e |-l |-r} #可以指定编辑哪个用户的crontab without specifying the default current user
CRONTAB-E (Edit user ' s crontab)
Crontab-l (list user ' s crontab)
Crontab-r (delete user ' s crontab)
Crontab-i (Prompt before deleting user ' s crontab)
Service Crond status #检查服务是否启动 (tips: General services with D, e.g. httpd)
Yum Vixie-cron&&yum Install Crontabs #安装corntab
Crontab configuration file Format:
* * * * * COMMAND
Five * numbers are represented from left to right: 0-59 minutes, 0-23 hours, 1-31 days, 1 ~ December, 0-7 weeks (0 and 7 for Sunday)
Case: 1, 10, 22nd 4:45 restart Apache per month
4 1,10,22 * * Service httpd restart
1 to 10 and 12 to 17th per month 4:45 restart Apache
4 1-10,12-17 * * Service httpd restart
Restart Apache every two minutes
*/2 * * * * Service httpd restart
1-59/2 * * * * Service httpd Restart (restart Apache per odd minute)
Summary:
* means match at any time
can use A,b,c to represent a or B or C when executing commands
The command can be executed with a-B representation between A and
You can use */a to represent every A-minute (hour, etc.) command execution
Crontab global configuration file in/etc/crontab
Log files in/var/log/cron
User profile in/var/spool/cron/user
Linux's Scheduled Tasks crontab