标题:CentOS设置系统时间、硬件时间、以及定时较对时间 出处:BirdSky 时间:Wed, 07 Apr 2010 20:17:41 +0000 作者:birdsky 地址:https://www.birdsky.cn/read.php?12 内容: CentOS设置系统时间和时区 一、设置时区 方法一:使用setup工具 setup 选择Timezone configuration 选择Asia/Shanghai 空格键勾选上System clock uses UTC 就OK了。 方法二:使用tzselect工具 tzselect 选择亚洲Asia 5 选择国家China 9 选择地区central China 3 确认选择Yes 1 设置好tzselect后,一定要重写/etc/localtime rm /etc/localtime ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 方法三:直接修改/etc/sysconfig/clock文件 vi /etc/sysconfig/clock ZONE="Asia/Shanghai" UTC=true ARC=false 重写/etc/localtime rm /etc/localtime ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 二、重启系统使时区生效 reboot 三、更新时间 更新系统时间 ntpdate cn.pool.ntp.org 更新硬件时间 hwclock --systohc 四、crontab定时较对时间 设置crontab定时较对时间 crontab -e 30 1 * * * ntpdate cn.pool.ntp.org ;hwclock --systohc PS: ntpdate命令安装 yum -y install ntp setup工具安装 yum -y install setuptool crontabs安装 yum -y install gcc gcc-c++ autoconf vixie-cron crontabs Generated by Bo-blog 2.0.2 sp1