Chinaunix首页 | 论坛 | 博客
  • 博客访问: 806509
  • 博文数量: 132
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 2276
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-03 10:50
个人简介

while(!dead) learning++;

文章分类

全部博文(132)

文章存档

2019年(3)

2018年(11)

2017年(12)

2016年(8)

2015年(8)

2014年(4)

2013年(86)

分类: LINUX

2013-02-04 11:38:25

通过ntpdate命令获取网络时间并且将其作为硬件时间:

/usr/sbin/ntpdate servername/ip && /sbin/hwclock --systohc > /dev/null 2>&1

 例: /usr/sbin/ntpdate tw.pool.ntp.org && /sbin/hwclock --systohc > /dev/null 2>&1

通用的servername:

asia.pool.ntp.org

cn.pool.ntp.org

hk.pool.ntp.org

tw.pool.ntp.org

sg.pool.ntp.org

 

手动设置系统时间:

date -s "time date"

date -s "12:30:00 20130204"

 

手动设置硬件时间:

hwclock --set --date="月/日/年 时:分:秒"(通用格式)

hwclock --set --date="2013/02/05 12:30:00" --->不用通用格式也可以

hwclock --set --date="20130205 12:30:00" ---->这样也行

 与crontab一起使用时注意crontab的时间是以系统时间为准的!

阅读(3624) | 评论(0) | 转发(1) |
0

上一篇:没有了

下一篇:CentOS修改系统默认语言与编码

给主人留下些什么吧!~~