第一个 * 表示分钟:取值范围 0-59

第二个 * 表示小时:取值范围0-23

第三个 * 表示天数:取值范围1-31

第四个 * 表示月份:取值范围1-12

第五个 * 表示每周:取值范围0-6

[root@localhost szy]# crontab -h
crontab:无效选项 -- h
crontab: usage error: unrecognized option
Usage:
 crontab [options] file
 crontab [options]
 crontab -n [hostname]

Options:
 -u <user>  define user
 -e         edit user's crontab
 -l         list user's crontab
 -r         delete user's crontab
 -i         prompt before deleting
 -n <host>  set host in cluster to run users' crontabs
 -c         get host in cluster to run users' crontabs
 -s         selinux context
 -x <mask>  enable debugging

Default operation is replace, per 1003.2
[root@localhost szy]# crontab -l
* */1 * * * /usr/sbin/ntpdate      cn.pool.ntp.org

重启crond 使其生效

systemctl restart crond.service

 

posted on 2022-11-24 14:31  Star*S  阅读(147)  评论(0)    收藏  举报