Linux time-of-day automatic Sync settings (rdate,ntpdate two methods)

Source: Internet
Author: User

There are at least two ways to synchronize time under Linux:
Rdate,ntpdate two kinds. CentOS minimized installation is not installed by default, first verify that it has been installed, or install it first.
Where Rdate itself is used to obtain time on the remote time server, with the-s parameter, you can apply the acquired time to the local system.

NAME
Rdate-get the time via the network
Synopsis
Rdate [-P] [-S] [-u] [-l] [-t sec] [host ...]
DESCRIPTION
Rdate connects to an RFC 868 time server over a TCP/IP network, printing the returned time
and/or setting the system clock.
OPTIONS
-P Print The time returned by the remote.

-S Set the system time to the returned time.

-U use UDP instead of TCP as the transport.

-l use Syslog to output errors (cron.warning) and output (Cron.info).

-T Set timeout in seconds for every attempt to retreive date.
rdate-s time.nist.gov
Ntpdate itself is the tool used to synchronize time.
Example: Ntpdate ntp.sjtu.edu.cn
NAME
Ntpdate-set the date and time via NTP

Disclaimer:the functionality of this program are now available on the NTPD program. See The-q com-
Mand line option in the Ntpd-network time Protocol (NTP) daemon page. After a suitable period of
Mourning, the Ntpdate program was to being retired from this distribution

Synopsis
ntpdate [ -46BBDQSUV] [-a key] [-e Authdelay] [-K keyfile] [-o version] [-p samples] [-t
Timeout] [-u user_name] server [...]
DESCRIPTION
[Refer to the Linux Man manual for details]
Date Time Server
Synchronization time, you must have a time server. Normally, we don't have to build it ourselves, we can use the public time service.
See common NTP server addresses and IP http://www.douban.com/note/171309770/in China
One of the national timing centers seems to be useless., we recommend using the Shanghai Jiaotong University NTP service ntp.sjtu.edu.cn or American Timing Center time.nist.gov
Rdate-s time.nist.gov
Ntpdate ntp.sjtu.edu.cn
Can be added to the crontab timing execution.

This article is from the "Boyhack" blog, make sure to keep this source http://461205160.blog.51cto.com/274918/1759840

Linux time-of-day automatic Sync settings (rdate,ntpdate two methods)

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.