首页 | 资讯动态 | linux基础 | 系统管理 | 网络管理 | 编程开发 | linux数据库 | 服务器技术 | linux相关 | linux认证 | 嵌入式 | 下载中心 | 专题 | linux招聘 | HR | 镜像
OKLinux中文技术站
·设为首页
·加入收藏
·联系我们
系统管理: 中文环境 系统管理 桌面应用 内核技术 | Linux基础: 基础入门 安装配置 常用命令 经验技巧 软件应用 | Linux数据库: Mysql Postgre Oracle DB2 Sybase other
网络管理: 网络安全 网络应用 Linux服务器 环境配置 黑客安全 | 编程开发: PHP CC++ Python Perl Shell 嵌入式开发 java jsp | PHP技术: PHP基础 PHP技巧 PHP应用 PHP文摘
搜索中心 Linux招聘 Linux专题 Apache | Linux相关: 硬件相关 Linux解决方案 Linux认证 企业应用 其它Unix | 相关下载: 资料下载 参考手册 开发工具 服务器类 软路由 其它
 技术搜索:
会员中心 注册会员 高级搜索  
  → 当前位置:首页>linux基础>安装配置>正文

Linux下关于两种时钟设置的问题

http://www.oklinux.cn  2007-08-06  赛迪网 kit  会员收藏  游客收藏  【 】 
您查看的文章来源于http://www.oklinux.cn

以下内容是关于帮助你在Linux下设置日期和时间的一些步骤,也包含了一点ntpd时间同步的内容。特别提醒的是在发行版本的限制是red hat系列,包括fedora,centos,redflag,unbreakable linux等。

 

There are two clocks to configure in Linux, the hardware clock and the system clock. The hardware clock determines the system clock on system boot. While the system is running, changes to one of these doesn't affect the other.

 

在Linux下有两个时钟需要配置,硬件时钟和系统时钟。硬件时钟在系统启动时决定系统时钟,当系统处于运行状态下时,修改其中任何一个并不能对另一个默认生效。

 

Note: it's best to set the hardware clock and have the system clock be set upon a reboot. Changing the system clock by using the date program on a running system could cause date discontinuities and consequently problems. If you will be using ntpd, you probably don't need to set either of these clocks (unless the current time is more than 1000s off the real time). Just setup ntpd and let ntpd adjust the time (it will do it in small steps to keep system timestamps reliable).

 

现在大部分的发行版本在图形界面下都提供了时钟设置工具,例如kde,gnome都有友好的 图形化工具,这里就不多说了。

 

You can use timeconfig to configure the timezone and UTC settings. Timeconfig will update /etc/sysconfig/clock and /etc/localtime.

 

Set the time zone manually if not already set.

 

Linux uses the file /etc/localtime to determine the time zone. This file should be either a copy of the appropriate timezone file from the directory /usr/share/zoneinfo or a symbolic link. If your time zone is incorrect, create a symbolic link to the appropriate timezone file.

 

 

# ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
Set whether hwclock uses local time or UTC

Edit the file /etc/sysconfig/clock and change "UTC=" to true or false. 
If you have a dual-boot system with Windows, using UTC may cause problems for Windows.


Set the system clock

# date MMDDhhmmCCYY.ss
where MM is month, DD is day, hh is hour, mm is minutes, 
CCYY is year and ss is seconds. Time should be in 24-hour notation.

To only set the time: 

# date -s hh:mm:ss
Set the hardware clock 

To set the hardware clock to the current system clock: 

# setclock
this method looks at /etc/sysconfig/clock to determine whether the hardware clock is set to UTC 

Another method: 

# hwclock --systohc# hwclock --systohc --utc
use the second option if you use UTC. 

Set hwclock manually: 

# hwclock --set --date="9/22/96 16:45:05"
Everytime you use the hwclock --set command, 
it will create or edit the file /etc/adjtime to determine the systematic drift.
Once you have some history,
you can use the --adjust option to adjust the hardware clock appropriately.
Run as a cron job if you want the clock to adjust automatically on a regular schedule.
Don't use the --adjust function when using ntpd since ntpd will turn the "11 minute mode" on,
which is best left alone. See the hwclock manpage for more info. 

Setup ntpd for automatic synchronization with a remote server. 

Run Red Hat's setup utility to make ntpd start on boot up and edit /etc/ntp.conf 

Set server and fudge options:

server time.nist.govfudge  time.nist.gov stratum 10
Enable multicastclient: 

multicastclient     # listen on default 224.0.1.1
Edit /etc/sysconfig/ntpd if necessary. The default should be fine.

Start the ntpd daemon:

# service ntpd start

 

 


上一篇:Ubuntu Linux系统上的三款超强监视工具   下一篇:在Linux平台上面如何设置网卡的绑定

收藏于收藏夹】 【评论】 【推荐】 【打印】 【关闭
相关文档
·Linux下中文输入法Fcitx-3.4.2的安装配置
·删除Linux系统后找回Windows的启动菜单
·Redhat Linux AS4下的LAMP与Discuz安装
·安装过程中Boot附加选项的含义是什么?
·ATI显卡的机器上安装Linux花屏解决办法
·Redhat系统下三种主要的软件包安装方法
·安装Linux操作系统引导时的命令参数介绍
·给VMWare下的Linux操作系统添加一块硬盘
·RedHat Linux AS4下安装配置CACTI的技巧
·输入法环境变量XMODIFIERS/GTK_IM_MODULE
·重装WindowsXP而不影响Ubuntu Linux系统
·轻便搞定通过U盘安装Ubuntu Linux
·关于RPM软件包使用方法的介绍
·从USB移动硬盘上引导Portable Linux详解
·Linux的GRUB引导程序配置方法大全
·Linux下kernel使用问题详细讲解
发表评论
密码: 匿名评论
评论内容:

(不超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规)
 
  最新文档
·Fedora11 beta i386安装图解
·红旗Linux 6.0 SP1桌面安装图解
·利用虚拟机在移动硬盘中安装Puppy Linu
·红旗Linux6.0 SP1桌面版安装 xfce 4.4.
·利用Ubuntu 8.10的usb-creator创建Live
·Ubuntu 8.10 更新源整理
·用kexec迅速切换内核
·Bazaar:分布式的版本控制系统
·Linux终端捕获
·openSUSE 11.0 NTFS分区硬盘安装过程
·GRUB2 引导程序的发展目标
·SUSE10.3恢复GRUB方法
  阅读排行
·Ubuntu 8.10 更新源整理
·从硬盘安装RHEL 5(Red Hat Enterprise
·Redhat5 Server下载、序列号以及相关介
·Linux对EXT3分区大小进行无损更改的步
· 在U盘上安装Damn Small Linux
·Fedora11 beta i386安装图解
·Ubuntu Linux 中 ADSL PPPoE 宽带上网
·主流显卡Linux驱动安装-Intel、ATi篇
·安装Ubuntu Linux分区的推荐方案和方法
·XP下硬盘安装Ubuntu8.04的2种方法
· U盘上运行的linux系统--babylinux
·Linux的GRUB引导程序配置方法大全
·新手学堂 详细讲解Ubuntu Server安装过
·Linux文件的复制、删除和移动命令
·让linux系统可以Mount NTFS分区
网摘收藏: