Linux时间总结
来源:互联网 发布:jre 8u51 windows x64 编辑:程序博客网 时间:2024/06/16 16:07
1.修改时区
1)安装ntpdate
使用命令: hwclock
1)查看硬件时间:
方法一. 开机的时候自动网络校时
[root@localhost ~]# cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime[root@localhost ~]# vi /etc/sysconfig/clockZONE="Asia/Shanghai"UTC=falseARC=false2.用ntpdate实现Internet时间同步
1)安装ntpdate
[root@localhost ~]# yum install –y ntpdate
2)同步时间
[root@localhost ~]# ntpdate time.nist.gov注:NTP(Network Time Protocol网络时间协议)
3.同步系统和硬件时间
linux系统时钟有两个,一个是硬件时钟(hc => hardware clock),即BIOS时间,就是我们进行CMOS设置时看到的时间,另一个是系统时(sys),是linux系统Kernel时间。当Linux启动时,系统Kernel会去读取硬件时钟的设置,然后系统时钟就会独立于硬件运作。有时我们会发现系统时钟和硬件时钟不一致,因此需要执行时间同步。使用命令: hwclock
1)查看硬件时间:
[root@localhost ~]# hwclock[root@localhost ~]# hwclock –-show2)时间同步:
hwclock –w 或 hwclock --systohc 把系统时间同步到硬件hwclock –s 或 hwclock --hctosys 把硬件时间同步到系统3)自动同步:
方法一. 开机的时候自动网络校时
[root@localhost ~]# vi /etc/rc.d/rc.local/usr/sbin/ntpdate time.nist.gov/sbin/hwclock -w方法二. 定时任务
5:10自动进行网络校时,并同时更新BIOS的时间[root@localhost ~]# crontab –e#每天凌晨05:10同步时间10 5 * * * /usr/sbin/ntpdate time.nist.gov ; /sbin/hwclock -w
0 0
- linux时间函数总结
- linux时间函数总结
- linux 时间函数总结
- Linux时间总结
- Linux时间系统调用总结
- Linux的时间函数总结
- linux 设备驱动程序 时间流 总结
- Linux下面time.h时间函数总结
- Linux下面time.h时间函数总结
- Linux下面time.h时间函数总结
- 修改linux系统时间方法 总结
- linux下的常用时间函数总结
- c/c++ 时间函数总结 linux
- linux 延时及时间函数总结
- Linux 下的时间编程总结
- linux主机时间同步总结(ntpdate)
- linux 延时及时间函数总结
- c/c++ 时间函数总结 linux-转
- hdu 1787 GCD Again
- java线程优先级越高越先执行吗
- 算法—排序(快排,冒泡)
- 【H5适配二】Meta标签中的format-detection属性及含义
- Java —— Web项目打包成war文件方法
- Linux时间总结
- Storyboard References
- COM口很多都被占用的解决办法
- HTML5<meta name="viewport"/>标签常见属性及说明
- 如何让网页适应所有的屏幕宽度+表格根据内容自适应
- 数据结构中的7种排序算法
- 获取布局填充器(获取布局解析器)
- Google Gson 使用简介
- 进程和线程