定时任务

查看定时任务

crontab -l

编辑定时任务-每2分钟更新一次时间

crontab -e  # 进入编辑页
# date
*/2 * * * * /usr/sbin/ntpdate ntp1.aliyun.com

# 首行注释,第二行命令
* * * * * # 代表每分,每时,每日,每月,每周
*/2 * * * * # 代表每2分
# /usr/sbin/ntpdate 是命令的路径,查看一个命令的路径
which 命令
# ntp1.aliyun.com是参数

  

原文地址:https://www.cnblogs.com/wwg945/p/8954761.html