CentOS Timing Synchronization System time

Source: Internet
Author: User
Tags vps

Use Linux.vps the next day, found that the system time is incorrect, manual modification or synchronization of the correct once, run half a day to find time and fast a few minutes, anyway, the longer it runs, the faster, is the VPS through?

and VPS Manager communication without fruit, and then search the Internet after the decision to use the timer automatic synchronization time calculation.

SSH execution Command:
#crontab-E
Add a line after execution: (as with the VI command, press I to enter edit mode, ESC returns to the command mode: w Save changes: Q exit)
*/30 * * * * /usr/sbin/ntpdate asia.pool.ntp.org >>/var/log/crontab.log 2>&1
The number 30 represents 30 minutes of execution, and after saving and exiting, it is also necessary to restart the timer task.
#service crond Restart

The following >>/var/log/crontab.log indicates that the timed execution is written to the log file to make it easy to see if there are any exceptions.

Note Utpdate to write the full path, some people on the Internet do not write the full path will cause the following exception:
/bin/sh:ntpdate:command not found


If your Linux system doesn't ntpdate this command at all,

Yum Install NTP

CentOS Timing Synchronization System time

Related Article

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.