Set Time Synchronization in linux

Source: Internet
Author: User

The time of the newly installed linux system is always different from the actual time. After a good time, as the system runs, it will be different from the time. Therefore, you need to synchronize the time with the standard time server. Ntp is a software installed in linux.
This section describes how to use ntp as the client to synchronize with the standard time server.
0. The ntpd service cannot be started before installation, because ntpd is a server, ntpdate is a client, and both cannot run simultaneously.
1. Because the time server (pool.ntp.org) is used, you must first set up the dns server.
Echo "nameserver 202.106.0.20">/etc/resolv. conf
2. manual synchronization
/Usr/sbin/ntpdate pool.ntp.org 3. Set the command to synchronize the time every one hour:
Crontab-e # Add 0 */1 ***/usr/sbin/ntpdate pool.ntp.org 2> & 1>/tmp/ntp. log;/sbin/hwclock-w
The first command is the synchronization time.
The second sentence is to write the time into the system hardware clock, so that the system does not have a wrong time after restart.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.