循环例行工作调度crontab用法
crontab和at的区别在于,at是一次工作调度完成即结束,crontab是循环例行工作调度。
SYNOPSIS
crontab [-u user] file
crontab [-u user] [-l | -r | -e] [-i] [-s]
-l,查阅crontab工作内容。
-r,删除crontab工作内容。
-e,编辑crontab工作内容。
-u,仅root可操作,帮其他用户新建/删除工作调度。
以上是针对用户,如果是系统的例行任务呢?编辑/etc/crontab文件即可。
[[email protected] /]# cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/# For details see man 4 crontabs
# 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
最新评论