1、连接需要对时的服务器

   $: ntpdate -u 服务器ip地址 

2、写对时任务的脚本

  #:crontab -e

选择 2(nano编辑):

59 23 * * * /usr/sbin/ntpdate -u ip 表示的意思是:每天晚上 23:59 对时一次 ;ip指的是服务器的ip

注意细节:是在root权限下创建的定时任务;

  

 

posted on 2017-07-25 15:36  coder_ornot  阅读(4452)  评论(0编辑  收藏  举报