When compiling kernel, some warning messages are found as follows: Warning:clock skew detected. Your build is incomplete.
The reason for this is that the current system's time is also before the last modification time of the files in the compiled directory, including the source program files and the compiled. O Target files, for example, I used the date command to see the time of August 24, 2000, and the file in the directory last modified by August 24, 2012.
The workaround is that you should first clean up the previously compiled ". O" target file and then run "make" to compile it, even if it has such a warning, because all of the targets will be recompiled. Of course, to remove this warning, you just need to modify the current time correctly.
You can modify the system time with the following command.
#date-S 08/25/2012
#date-S 13:12:00
(or: #date-S "08/25/2012 13:12:00", the format here is "mm/dd/yyyy hh:mm:ss")
Date Commands More learning
Part I: Setting time
We generally use the "date-s" command to modify the system time (this is the system time, Linux is maintained by the operating system). )。 For example, set the system time to the June 10, 1996 command as follows.
#date-S 06/10/96
The command to set the system time to 1:12 P.M. 0 seconds is as follows.
#date-S 13:12:00
Set the date time to June 10, 1996 1:12 P.M. 0 seconds to use
#date-S "06/10/1996 13:12:00"
The format here is "mm/dd/yyyy hh:mm:ss."
Or
#date 061013121996.00
The format here is MMDDHHMMYYYY.SS (Month day, year. seconds)
When the system starts, the Linux operating system reads the time from the CMOS to the system time variable, and later modifies the time by modifying the system time. To keep the system time consistent with the CMOS time, Linux writes the system time to the CMOS at intervals. Since this synchronization takes place every once in a while (about 11 minutes), after we perform date-s, if the machine is immediately reset, the modification time may not be written to CMOS, which is the cause of the problem. If you want to ensure that the changes take effect, you can execute the following command.
#hwclock-W
This command forces the system time to be written to CMOS (equivalent to Hwclock--SYSTOHC)
================
Linux divides the clock into both the system clock (systems Clock) and the hardware (real time Clock, the RTC) clock. System time is the clock in the current Linux kernel, and the hardware clock is the battery-powered motherboard hardware clock on the motherboard, which can be set in the BIOS standard BIOS feture key.
In Linux, the commands for clock viewing and setting are mainly date, hwclock, and clock. The clock and hwclock usages are similar, except that the clock command supports the Alpha hardware system in addition to the x86 hardware system. Because most users currently use the x86 hardware system, these two commands can be viewed as a command to learn.
1. Use the date command in the virtual terminal to view and set the system time
To view the operation of the system clock:
#date
To set the system clock operation:
#date 091713272003.30
Common formatting:
#date months and years. seconds
2. View and set the hardware clock using the Hwclock or clock command
View hardware Clocks
#hwclock--show
Or
#clock –show
September 17, 2003 Wednesday 13:24 11 sec -0.482735 seconds
To set the hardware clock operation:
# Hwclock--set--date= "09/17/2003 13:26:00"
Or
# clock--set--date= "09/17/2003 13:26:00"
Common formatting: Hwclock/clock--set--date= "month/day/year: min: sec".
3. Sync system clock and hardware clock
Linux System (the author is using Red Hat 8.0, other systems did not do experiments) after the default reboot, the hardware clock and the system clock synchronization. If it is not easy to reboot (the server usually rarely restarts), use the clock or hwclock command to synchronize the system clock and hardware clock.
Hardware clock Sync system clock
# Hwclock--hctosys
Or
# Clock–hctosys
In the above command,--hctosys represents hardware Clock to SYStem Clock.
system clock Sync Hardware clock
# Hwclock--SYSTOHC
Or
# hwclock-w
Or
# CLOCK–SYSTOHC
Enter #hwclock--help View all parameters and formats
Part Two: Setting the time zone
Configure Document/etc/sysconfig/clock
#
Zone= "Asia/shanghai"
Utc=false
Arc=false
~
Alternatively, you can use the Tzslect command to select the time zone.
Look at the following documents:
Http://delxu.spaces.live.com/Blog/cns!D04F87F9ED029F69!409.entry
Part III: Set clock synchronization--NTP
1 Linux (take Redhat Linux for example)
Configure NTP configuration file/etc/ntp.conf
Add the following content
#---Our timeservers-----
Server 10.86.2.9 prefer
Server 10.56.254.131
Server 2.pool.ntp.org
and restart NTPD.
#/sbin/service NTPD Restart