linux_centos7_时间更新

EDT:美国时间            CST:中国北京时间

方法一、使用ntpdate从时间服务器更新时间:

1、下载ntpdate组件

yum install -y ntp

2、完成后直接测试

[root@git conf.d]# ntpdate asia.pool.ntp.org
21 Mar 10:52:01 ntpdate[9247]: step time server 209.58.185.100 offset 38761.507576 sec

3、使用crontab定时更新时间

# crontab –e   //输入该命令后将定时任务添加进去

*/10 * * * * ntpdate asia.pool.ntp.org

4、推荐的服务器:

time.nist.gov
time.nuri.net
asia.pool.ntp.org
asia.pool.ntp.org
asia.pool.ntp.org
asia.pool.ntp.org

方法二、使用服务器直接更新

mv /etc/localtime /etc/localtime.bak  
ln -s /usr/share/zoneinfo/Asia/Shanghai  /etc/localtime  
date  

 

 

posted @ 2019-04-08 18:10  wanchen  阅读(777)  评论(0编辑  收藏  举报