立即注册【分享大片】 登录
BluRayCD Forum 返回首页

kmvodys的个人空间 https://forum.bluraycd.com/?3 [收藏] [复制] [RSS]

日志

CentOS设置系统时间、硬件时间、以及定时校对时间

已有 839 次阅读2015-6-14 17:47 |个人分类:Centos|系统分类:服务器| CentOS设置, 系统时间, 硬件时间, 校对时间

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

路过

鸡蛋

鲜花

握手

雷人

评论 (0 个评论)

facelist doodle 涂鸦板

您需要登录后才可以评论 登录 | 立即注册【分享大片】

小黑屋|手机版|Archiver|4K蓝光论坛

GMT+8, 2024-4-25 23:44

Copyright © 2001-2021, Gadaddy Cloud.

返回顶部