0002_20190328_Centos修改系统时间
生活随笔
收集整理的這篇文章主要介紹了
0002_20190328_Centos修改系统时间
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
一.?? 設(shè)置修改時間:
2. 查看時間和日期:
[root@localhost bin]# date2019年 03月 28日 星期四 11:32:38 CST3. 查看硬件時間:
[root@localhost bin]# hwclock --show4. 設(shè)置當(dāng)前日期:
[root@localhost bin]# date -s 2019-3-285. 設(shè)置硬件時間:
[root@localhost bin]# hwclock --set --date="2019-3-28 11:41:05"6.設(shè)置當(dāng)前時間:
[root@localhost bin]# date -s 11:34:282019年 03月 28日 星期四 11:34:28 CST7.將當(dāng)前時間寫入BIOS, 防止重啟失效
[root@localhost bin]# hwclock –w8. 替換系統(tǒng)時區(qū)時間:
設(shè)置中國時區(qū)使用重慶時間
[root@localhost bin]# cp /usr/share/zoneinfo/Asia/Chongqing /etc/localtime?二.?? 時間同步:
2. 同步網(wǎng)絡(luò)上的時間:
a) 同步網(wǎng)絡(luò)時間需要安裝ntpdate時間同步服務(wù)軟件; b) 檢查本機(jī)是否安裝ntpdate[root@localhost ~]# yum list installed | grep ntpdate [root@localhost ~]# rpm -qa |grep ntpd*c) 使用yum安裝ntpdate[root@localhost ~]# yum install -y ntpdated) 選擇服務(wù)器同步時間, 可用的服務(wù)器有下面幾個: time.nist.gov time.nuri.net 0.asia.pool.ntp.org 1.asia.pool.ntp.org 2.asia.pool.ntp.org 3.asia.pool.ntp.org [root@localhost ~]# ntpdate time.nist.gov #同步時間服務(wù)器三.?? 添加定時任務(wù), 同步時間:
a)???????? 每隔一小時同步網(wǎng)絡(luò)時間
[root@localhost ~]# #* */1 * * * root ntpdatetime.nuri.net;hwclock -w?
轉(zhuǎn)載于:https://www.cnblogs.com/wxylog/p/10614038.html
總結(jié)
以上是生活随笔為你收集整理的0002_20190328_Centos修改系统时间的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: JS 常用语法
- 下一篇: java信息管理系统总结_java实现科