关于CentOS设置系统时间命令介绍
2014-06-10 13:46
288 查看
来自 http://www.zdh1909.com/html/Cisco/18945.html
一、设置时区
方法一:使用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
一、设置时区
方法一:使用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
相关文章推荐
- CentOS下date命令 - 显示和设置系统日期与时间
- 用date命令给CentOS Linux设置修改系统日期和时间的方法
- centos设置当前系统时间命令
- CentOS设置系统时间、硬件时间、以及定时校对时间
- linux 的date命令及系统时间设置
- [转]设置修改CentOS系统时区/时间
- linux的date命令及系统时间设置
- linux 的date命令及系统时间设置
- linux 的date命令及系统时间设置
- linux 的date命令及系统时间设置
- linux 的date命令及系统时间设置
- linux 的date命令及系统时间设置
- linux 的date命令及系统时间设置
- CentOS下设置系统时间与硬件时间
- linux 的date命令及系统时间设置
- linux系统下的ps命令介绍 查看某个时间点的程序动行情况
- Redhat/CentOS系统中YUM常用命令介绍
- Linux下通过命令设置系统时间
- php 运行系统命令设置时间的方法
- linux查看、设置系统时间命令