ntp server of windows and linux

| tags crontab  ntp 

在使用windows和虚拟linux系统时,常常出现时间不同步的现象。甚为麻烦。 现在需要配置ntp sever做一个同步,当然前提是要能连接到网咯。

1 tzselect设置zone 或者: 时区信息保存在/usr/share/zoneinfo里面 ln -s /etc/localetime /usr/share/zoneinfo/...

2 ntp同步设置 ntpdate ntp.fudan.edu.cn && hwclock -w

3 设置crontab # For details see man 4 crontabs

# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name  command to be executed
  10 10 *  *  * /usr/sbin/ntpdate ntp.fudan.edu.cn&&/sbin/hwclock -w

上一篇     下一篇