Linux One of them ntp The package can automatically calibrate the time , And it's very easy to use .
Debian System installation NTP Timing pack :
1 apt-get install ntpdate
CentOS System installation NTP Timing pack :
1 yum install ntp
Timing command :
1 ntpdate cn.pool.ntp.org
If you want to automatically adjust the time every certain time , Just add the above command to the Cron That's it :
1 00 12 * * * /sbin/ntpdate cn.pool.ntp.org
* cn.pool.ntp.org yes ntp Chinese time service source of network time service organization
Method 2
Quick proofreading linux Server time to Beijing time
The server adopts ntp Update time , Often involved UTC Whether to open or not , When it's turned on, the time will be fast 8 Hours
Some time ago, my friend gave me the following order , One command solves all previous problems .
rdate -t 60 -s stdtime.gov.hk
use rdate take stdtime.gov.hk Server time grab back , Then write to the hardware
hwclock -w
Here is rdate How to use the command of
Function description : Displays the date and time of other hosts .
language method :rdate [-ps][ Host name or IP address ...]
Supplementary notes : implement rdate instructions , Ask other hosts for the system time and display it .
ginseng number :
-p Displays the date and time of the remote host .
-s Send the date and time received from the remote host , System time saved back to local host .
Technology
Daily Recommendation