Change Time Zone (TZ)
cp /usr/share/zoneinfo/Asia/Taipei /etc/localtime
vim /etc/sysconfig/clock
change Etc/UTC to Asia/Taipei or yourself
TZ can look in http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
Install NTP
yum install ntp
chkconfig ntpd on
vim /etc/ntp/step-tickers
add
0.pool.ntp.org
1.pool.ntp.org
2.pool.ntp.org
3.pool.ntp.org
service ntpd restart
now your time is auto sync
so it’s fix
Bash
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
#!/bin/bash # created by "Matt" on idclayer.com # Centos Fix Part #fix NTP yum -y install ntp chkconfig ntpd on cp /usr/share/zoneinfo/Asia/Hong_Kong /etc/localtime rm -rf /etc/sysconfig/clock echo -n " ZONE="Asia/Hong_Kong" ">>/etc/sysconfig/clock echo -n " 0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org ">>/etc/ntp/step-tickers service ntpd restart |
save fix.sh
and run ” bash fix.sh”