liunx系统时间的同步



liunx系统时间的同步
 
liunx服务器调整过来后有出现问题,只能使用liunx的crontab定时同步时间了:
 
Java代码
ntpdate asia.pool.ntp.org  
hwclock -w
clock -w
www.2cto.com  
crontab -e  
0 */1 * * * /usr/sbin/ntpdate  asia.pool.ntp.org >> /var/log/ntpdate.log
 
首先调整系统当前时间并写入liunx内核时钟,每个小时同步一次
 
利用liunx定时去同步时间,并将日志输出到ntpdate.log日志文件中.

相关内容

    暂无相关文章