If the server's time is messed up, it can cause a lot of unexpected problems. Using NTP, you can make the server get the right time to avoid problems.
NTP is a network time protocol, meaning "Network Time Protocol", is a TCP/IP protocol to achieve the synchronization protocol.
Ubuntu automatically goes to NTP every time it starts. ubuntu . com to do time synchronization. However, because the server generally does not start frequently, it is still not possible to avoid time deviation, and this deviation can be very large. Therefore, we need to revise the time of the server periodically. The easiest way to do this is to use Cron's scheduled tasks to do one time synchronization a day. For example, create a file/etc/cron.daily/timeupdate:
___fckpd___0nbsp;sudo nano/etc/cron.daily/timeupdate
Then enter the following:
Ntpdate ntp.ubuntu.com
After you save the file, you also need to give it executable permissions:
___fckpd___2nbsp;sudo chmod 755/etc/cron.daily/timeupdate
This allows the system to ntp.ubuntu.com fetch time every day (all tasks under the/etc/cron.daily/directory will be executed once a day) and calibrate the server itself. If you are concerned that time has failed, you can add multiple NTP servers to the/etc/cron.daily/timeupdate file:
Ntpdate ntp.ubuntu.com pool.ntp.org