Walker's requirement is to execute a shell script at 1 o'clock every day, following the basic features that Walker uses.
1. Installation
Yum Install Crontabs
2. Service-related
/sbin/service crond status #查看任务状态/sbin/service crond start #启动服务/sbin/service crond stop #关闭服务/sbin/ Service Crond Restart #重启服务/sbin/service crond Reload #重新载入配置
3 . View Scheduled Tasks. Basic command line parameters are recommended to use crontab--help , mancrontab too cumbersome.
Crontab-l #查看当前用户计划任务crontab-U userx-l #查看userx用户的计划任务
4 . View the task execution log.
Tail-f/var/log/cron
5,/etc/crontab file inside the system planning tasks,/var/spool/cron/directory inside according to the user to store scheduled tasks.
6. Edit the/etc/crontab Configuration Schedule task.
Shell=/bin/bashpath=/sbin:/bin:/usr/sbin:/usr/binmailto=roothome=/# for details see man 4 crontabs# example of job definition:# .---------------- minute (0 - 59) # | .------------- hour (0 - 23) # |  | &NBSP:---------- day of month (1 - 31) # | |  | &NBSP:------- month (1 - 12) or jan,feb,mar,apr ...# |   |  |  | &NBSP---- day of week (0 - 6) (sunday=0 or 7) or sun,mon,tue,wed,thu,fri,sat# | | | | |# * * * * * [user-name] command to be executed 0 1 * * * root /home/walker/test.sh
The content format of the scheduled task file in the/var/spool/cron/directory is identical to the above. The difference is that/var/spool/cron/must specify the user;/etc/crontab is a system scheduled task that can be specified without a user.
Walker * * *
This article is from "Walker's Journal" blog, please be sure to keep this source http://walkerqt.blog.51cto.com/1310630/1690113
CentOS uses crontab to perform scheduled tasks