yum install -y rdate

 

服务器请设置
*/5 * * * * /usr/bin/rdate -s time-b.nist.gov

 

ubuntu

设定时区:dpkg-reconfigure tzdata

           选择Asia -> 再选择Shanghai -> OK

同步时间命令:

           1、sudo apt-get install ntpdate // 安装时间同步工具


           2、sudo ntpdate cn.pool.ntp.org // 与网络服务器同步时间

 

          3、date // 查看时间是否已同步

 

posted on 2017-09-01 13:00  凌度  阅读(587)  评论(0编辑  收藏  举报