Centos time synchronization method

  

The newly installed server may be set incorrectly. You need to adjust the time zone and adjust the time. The following is to use NTP to synchronize from a time server

cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

ntpdate us.pool.ntp.org

Very simple, parsing, the first sentence is to adjust the current time zone to Shanghai is +8 zone, want to change other The time zone can also go to the /usr/share/zoneinfo directory;

Then the second sentence is to use ntpdate to synchronize the standard time.


If you don't have ntpdate installed, you can yum it. :

yum install ntp

Add a scheduled task to synchronize the clock every 10 minutes

crontab -e

0-59/10 * * * * /usr/sbin/ntpdate us.pool.ntp.org |  Logger -t NTP

China National Time Service Center: http://www.time.ac.cn/stime.asp

Other network time server addresses are as follows: (You can also search for yourself) )

time.nist.gov (US) ntp.fudan.edu.cn (Fudan) (Recommended for domestic users) timekeeper.isi.edu subitaneous.cpsc.ucalgary.ca usno.pa- X.dec.com time.twc.weather.com swisstime.ethz.ch ntp0.fau.de ntp3.fau.de time-a.nist.gov time-b.nist.gov time-nw.nist.gov nist1- Sj.glassey.com

210.72.145.44 is also a good address, very fast!

Copyright © Windows knowledge All Rights Reserved