Linux:解决Linux中crontab不执行ntpdate问题(成功解决:/bin/sh: ntpdate: command not found)

原因:
打开配置文件加入

*/1 * * * * ntpdate ntp4.aliyun.com

在这里插入图片描述
每分钟同步时间,看上去没什么问题,保存之后就会经常的弹出You have new mail in /var/spool/mail/root

当打开这个文件会看到如下错误:
/bin/sh: ntpdate: command not found
在这里插入图片描述

解决办法:

  • 使用whereis命令查找ntpdate命令
    在这里插入图片描述
  • 然后重新更改crontab定时任务
    在这里插入图片描述
发布了135 篇原创文章 · 获赞 318 · 访问量 25万+

猜你喜欢

转载自blog.csdn.net/weixin_43563705/article/details/103573469
今日推荐