crontab
编辑定时任务
crontab -e
查看定时任务
crontab -l
系统中每个用户创建的定时任务存放位置
/var/spool/cron/用户名称的文件中
定时任务格式
Example of job definition:
.---------------- minute (0 - 59)
| .------------- hour (0 - 23)
| | .---------- day of month (1 - 31)
| | | .------- month (1 - 12) OR jan,feb,mar,apr ...
| | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
| | | | |
* * * * * user-name command to be executed
分 时 日 月 周
例:时间同步定时任务
*/5 * * * * /usr/sbin/ntpdate ntp.api.bz >/dev/null 2>&1