Ubuntu系统下ntp服务器搭建2
来源:互联网 发布:px4源码分析 编辑:程序博客网 时间:2024/05/29 15:09
上一篇文章主要讲NTP服务器的,在使用过,还遇到其它和时间有关的问题,本篇文章写写在同步时间和改时区方面的笔记。
时区修改
Thu Aug 21 18:18:29 PDT 2014
Please identify a location so that time zone rules can be set correctly.
Please select a continent or ocean.
1) Africa
2) Americas
3) Antarctica
4) Arctic Ocean
5) Asia
6) Atlantic Ocean
7) Australia
8) Europe
9) Indian Ocean
10) Pacific Ocean
11) none - I want to specify the time zone using the Posix TZ format.
1) east China - Beijing, Guangdong, Shanghai, etc.
2) Heilongjiang (except Mohe), Jilin
3) central China - Sichuan, Yunnan, Guangxi, Shaanxi, Guizhou, etc.
4) most of Tibet & Xinjiang
5) west Tibet & Xinjiang
#? 1
The following information has been given:
China
east China - Beijing, Guangdong, Shanghai, etc.
Therefore TZ='Asia/Shanghai' will be used.
Local time is now: Fri Aug 22 09:17:17 CST 2014.
Universal Time is now: Fri Aug 22 01:17:17 UTC 2014.
Is the above information OK?
1) Yes
2) No
#? 1
Fri Aug 22 09:19:40 CST 2014
NTP同步时间
sudo ntpdate cn.pool.ntp.org
Mon Aug 25 15:53:55 CST 2014
除了用域名的方式,更多的是用IP地址的方式,如上海交大NTP服务器地址是202.120.2.101,国家授时中心服务器地址是210.72.145.44(这个服务器时灵时不灵,亲测所得经验)。命令和上面一样:
ntpdate -u 202.120.2.101
The offset specifies the time value you must add to the local time to get a Coordinated Universal Time value. It has syntax like [+
|-
]hh[:
mm[:
ss]]. This is positive if the local time zone is west of the Prime Meridian and negative if it is east. The hour must be between 0
and 24
, and the minute and seconds between 0
and 59
.
For example, here is how we would specify Eastern Standard Time, but without any Daylight Saving Time alternative:
EST+5
在我所参与的项目中,遇到一个bug,修改时区时,就会更改时间文件的内容。比如,我在上位机将东八区改为东六区后,这里东八区的GMT-8文件的内容被改为东六区的时区内容——注意,是文件内容,不是文件名称。后来才发现,原来有一个地方是不必要的,如下:
cp -f /usr/share/zoneinfo/Etc/GMT-8 /usr/share/zoneinfo/localtime
需要说明的是这个做法是以前项目的,而以前项目用的根文件系统都是基于内存的系统,系统运行时,随便改,都没问题,但这个项目却是存储在硬盘上的,一点改动,都将记录、保存下来。这也需要我们在实践时注意某些平台的不同所带来的问题。有时候,细节真的能决定很多东西,而不是像人们所说的:这不是大问题。
李迟,完成于2015年年初,发表于已未年正月初五晚上
- Ubuntu系统下ntp服务器搭建2
- Ubuntu系统下ntp服务器搭建
- linux系统下搭建NTP服务器
- Ubuntu搭建ntp服务器
- ubuntu搭建NTP服务器
- ubuntu搭建ntp服务器
- ubuntu搭建内部NTP服务器
- 搭建Linux下NTP服务器
- Ubuntu下安装NTP服务器
- ubuntu上搭建ntp时间服务器
- CentOS6.5系统搭建NTP服务器
- Linux下搭建ntp时钟服务器
- Ubuntu系统下搭建FTP服务器图解
- ubuntu系统下搭建git服务器
- Linux下PPPOE服务器及NTP服务器的搭建
- linux搭建ntp服务器
- NTP服务器搭建
- NTP服务器搭建
- STM32F429i disco 体验
- sgu144
- C#WinForm窗体美化(IrisSkin皮肤插件的使用)
- 如何让ajaxfileupload.js支持IE9,IE10,并可以传递多个参数?
- 第16周-矩阵下三角元素之和
- Ubuntu系统下ntp服务器搭建2
- CentOS(一)最小化安装系统
- CSDN文章列表的CSS实现
- [UVA1252] Twenty Questions && 状压DP
- B树
- HTML5 Boilerplate: 最流行的web开发前端模版
- 迷宫问题二 统计路径条数(dfs+回溯)
- MS SQL专用管理员连接DAC
- iOS中的ARC