linux服务器校对时间方法
来源:互联网 发布:数控车床g84攻牙编程 编辑:程序博客网 时间:2024/06/10 19:41
Linux中有个ntp包可以自动校准时间,并且非常好用。
Debian系统安装NTP校时包:
1 apt-get install ntpdate
CentOS系统安装NTP校时包:
1 yum install ntp
校时命令:
1 ntpdate cn.pool.ntp.org
如果想每隔一定时间自动校时,只需将上面的命令加入至Cron就行了:
1 00 12 * * * /sbin/ntpdate cn.pool.ntp.org
Debian系统安装NTP校时包:
1 apt-get install ntpdate
CentOS系统安装NTP校时包:
1 yum install ntp
校时命令:
1 ntpdate cn.pool.ntp.org
如果想每隔一定时间自动校时,只需将上面的命令加入至Cron就行了:
1 00 12 * * * /sbin/ntpdate cn.pool.ntp.org
* cn.pool.ntp.org是ntp网络授时组织的中国授时源
方法二
快速校对linux服务器时间至北京时间
服务器采用ntp更新时间,经常牵扯到UTC是否开启的问题,开启了时间就会快8个小时
前段时间朋友给我了下面的命令,一条命令解决之前的所有问题。
rdate -t 60 -s stdtime.gov.hk
使用rdate将stdtime.gov.hk服务器的时间抓取回来,然后写入硬件
hwclock -w
下面是rdate的命令使用方法介绍
功能说明:显示其他主机的日期与时间。
语 法:rdate [-ps][主机名称或IP地址...]
补充说明:执行rdate指令,向其他主机询问系统时间并显示出来。
参 数:
-p 显示远端主机的日期与时间。
-s 把从远端主机收到的日期和时间,回存到本地主机的系统时间。
0 0
- linux服务器校对时间方法
- linux服务器校对时间方法
- linux服务器校对时间方法
- linux服务器校对时间方法
- linux服务器校对时间方法
- linux服务器时间校对
- linux服务器时间校对
- linux 下校对服务器时间
- delphi网络时间校对
- windows下ntp时间校对
- 从互联网校对系统时间
- 全局意译 之 校对方法
- linux配置时间服务器
- linux设置时间服务器
- linux设置时间服务器
- linux 更改服务器时间
- linux设置时间服务器
- 校准linux服务器时间
- js跨域
- Oracle Connect by 用法解析
- ARC下内存需要做的手动管理
- Software-Building-HOWTO_1
- mybatis中mapper.xml文件详解
- linux服务器校对时间方法
- 被坑的简单设计
- 修改默认闹铃为不振动
- 删除链表中倒数第n个节点
- Web开发中的Filter使用
- 免费的编辑-markdown
- Scrollview
- AutoLayout 中使用 UIScrollView (多个ContentView)
- 头文件 string.h cstring string 区别