Linux system slow time running Solution

Source: Internet
Author: User
Tags net time
Linux system time running slow solution-Linux Enterprise Application-Linux server application information. The following is a detailed description. The second solution to slow LINUX system time is suitable for LAN and Internet

Linux 2. 6. * In the kernel, the system always runs for nearly an hour slower than the normal time. It is very depressing to see that many people have such problems and do not know whether it is 2. 6. * This is a common problem. Many people have said so. Let's just say so.

I have found N more solutions on the Internet to solve the problem of slow LINUX system time, but I don't feel good. There is no cure. After a lot of attempts, I found a second solution, which is suitable for LAN and Internet use. The premise is that the computer is on when I come to school, and the time is relatively accurate.

I don't know if it is good for others. I feel very useful. I will write it out and share it with you.

If you want to use a computer on the INTERNET, you can use ping Domain Name

Then use the PING address to replace the address used later.

All commands are executed under the ROOT identity.

1. Write a shell script
PATH = $ PATH:.:/bin:/usr/sbin

# Vi mansettime. sh
######################################## ##
#! /Bin/bash
Net time set-I 220.194.69.38
######################################## ##

# No Intranet Internet
#! /Bin/bash
# Ntpdate URL

Save and exit Esc: wq.

192.168.10.80 is the IP address of a WINDOWS computer on my LAN.

2. Save the file to/usr/bin/mansettime. sh. the random file name is also casual, but do not use system commands, otherwise conflict

# Mv mansettime. sh/usr/bin/mansettime. sh

3. Change file attributes

Chmod + x/usr/bin/mansettime. sh

4. Add a job for the ROOT user to execute the SHELL at every hour 24 hours a day, 7 days a week.

# Crontab

50 ***/home/xf/mansettime. sh 2> & 1>/dev/null
# School time at 03:02 every day
2 3 ***/home/xf/mansettime. sh 2> & 1>/dev/null
Then press Ctrl + D

In this way, the system will automatically go to school at 50 minutes every hour and at 192.168.10.80, saving you a lot of trouble and using little system resources.

If there is a better way to send a message, thank you

PS: You can use crontab-e to edit existing jobs of the current user and use crontab-l to view the job information of the current user. Because the ROOT permission is required to set the system time, you must use the ROOT identity to add jobs.
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.