Linux下ntpdate时间同步
来源:互联网 发布:ubuntu如何安装matlab 编辑:程序博客网 时间:2024/06/02 12:59
原文地址:http://gaoxingf.blog.51cto.com/612518/121959 作者:高兴F
Linux下ntpdate时间同步
Ntp服务器安装配置
RedHat服务器可以下载rpm安装包,然后执行
# rpm -ivh ntp-4.2.0.a.20040617-4.x86_64.rpm 或 # yum -y install ntp.x86_64
时间同步方法
同步命令
# ntpdate ntp服务器域名或IP
例如:# ntpdate 1.cn.pool.ntp.org
http://www.pool.ntp.org是NTP的官方网站,在这上面我们可以找到离我们国家的NTP Server cn.pool.ntp.org.它有3个服务器地址:
服务器一: 1.cn.pool.ntp.org
服务器二: 2.asia.pool.ntp.org
服务器三: 3.asia.pool.ntp.org
服务器二: 2.asia.pool.ntp.org
服务器三: 3.asia.pool.ntp.org
(直接用域名有时有问题,可以先Ping出他们的IP,然后用IP地址同步)
自动运行同步时间脚本设定
# crontab –e
添加脚本例子如下:
*/20 * * * * /usr/sbin/ntpdate 210.72.145.44 //每20分钟执行一次
30 5 * * * /usr/sbin/ntpdate 210.72.145.44 //每天早晨5点半执行
※ 前面五个*号代表五个数字,数字的取值范围和含义如下:
分钟(0-59) 小時(0-23) 日期(1-31) 月份(1-12) 星期(0-6)//0代表星期天
设定完毕后,可使用# crontab –l 查看上面的设定。
问题:在虚拟机(vmware server)上使用时间同步的时候,虽然设定了自动同步,但有些时候还是会时间不准确,具体原因我也没弄太明白,因为有时好用,有时不好用,我也没一直盯着它研究~~~有机会再研究了~
Linux系统时间日期手动修改
查看当前时间 # date
修改时间命令 # date –s 12:12:00
修改日期命令 # date –s 01/12/2008
Linux系统时区修改
查看当前时区 # vi /etc/sysconfig/clock
修改时区命令 # tzselect 或 # timeconfig
如果知道时区名称也可以直接使用命令如:# TZ='Asia/Shanghai'; export TZ //改为+8中国上海时区
或 使用新的时区文件覆盖系统默认时区(测试最有效)
例 # cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime //亚洲上海时区替换系统时区
同步BIOS时钟,强制将系统时间写入CMOS,使之永久生效,避免系统重启后恢复成原时间。
# clock -w
查看BIOS时间命令: # hwclock -r
0 0
- Linux下ntpdate时间同步
- Linux下ntpdate时间同步
- Linux下ntpdate时间同步
- Linux下ntpdate时间同步
- Linux下ntpdate时间同步
- Linux下ntpdate时间同步
- Linux下使用ntpdate进行时间同步
- Linux系统下使用ntpdate同步时间
- linux下使用ntpdate同步网络时间
- ntpdate linux时间同步命令
- Linux使用ntpdate时间同步
- linux 时间同步、ntpd、ntpdate
- linux ntp ntpdate 同步时间
- linux时间同步,ntpd、ntpdate
- linux时间同步,ntpd、ntpdate
- linux ntpdate同步网络时间
- linux时间同步,ntpd、ntpdate
- linux时间同步,ntpd、ntpdate
- 怎样确定 Org 所用的 Ledger 是什么
- 查看网络图片
- 使用POI中的XSSFWorkbook操作excel2007(xlsx)的异常:找不到类解决
- MySQL导入sql脚本错误:2006 - MySQL server has gone away
- 《猜猜看》之界面设置
- Linux下ntpdate时间同步
- Java基础总结之异常
- chm文件打开是空白的
- OJ第三批——Problem F:C++习题 输入输出--保护继承
- 自定义table
- 使用android的webview控件访问有道词典的url
- 聚焦
- springmvc+spring data 在用EntityManager类的query.getResultList()类型转换
- 隐藏文件夹及子文件