If you only need to synchronize once, then execute the following command to rdate-stime.nist.gov where time.nist.gov is a time server, of course you can also use another time server. If the time of multiple servers needs to be fully synchronized, it is best to configure a unified automatic synchronization task for these servers to avoid time deviations for various reasons. Use crontab to enable linux
If you only need to synchronize data once, run the following command:
Rdate-s time.nist.gov
WhereTime.nist.govIs a time server, of course, you can also use another time server.
If the time of multiple servers needs to be fully synchronized, it is best to configure a unified automatic synchronization task for these servers to avoid time deviations for various reasons. The method is as follows:
Use crontab to automatically synchronize time in linux
Vi/etc/crontab
Add the following sentence:
00 0 1 * * root rdate -s time.nist.gov
Time.nist.gov is a time server.