Linux server time setting command

hwclock -r # BIOS time to read

hwclock -w # to the current system time into the BIOS


date -s 2010/10/02 # Set date

date -s 15:02:35 # set the minutes and seconds


/ Usr / bin / rdate rdate.darkorb.net # 1 Time synchronization

/ Usr / sbin / ntpdate time.nist.gov # 2 Time Synchronization


# Set the time zone

cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime


# BIOS clock synchronization to force the system time to write CMOS, the following command: 

clock -w


# Add regular tasks, 0:00 daily automatic synchronization time

crontab -e

0 0 * * * /usr/bin/rdate -s rdate.darkorb.net

Perhaps some friends servers are not set up a scheduled task to synchronize time over it, suggest that you add a timing synchronization, time server and the user's system to avoid the time difference is too big

Reproduced in: https: //my.oschina.net/zhouz/blog/213195

Guess you like

Origin blog.csdn.net/weixin_33672400/article/details/91728388