Linux服务器同步网络时间
来源:互联网 发布:三国志mac下载地址 编辑:程序博客网 时间:2024/06/18 00:03
为什么要时间同步???
1.查看时区是否正确 一般我们的是 Asia/Shanghai 时区
若不是,则需要修改时区 两个文件 /etc/localtime 和 /etc/sysconfig/clock
一、修改时区:
# cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
修改为中国的东八区
# vi /etc/sysconfig/clock
ZONE="Asia/Shanghai"
UTC=false
ARC=false
二 、时间同步
ntp服务器 0.asia.pool.ntp.org、time.nist.gov、ntp.api.bz
三、定时同步时间(crond -e) 或者开机同步时间(编写脚本到 /etc/init.d/)
crontab格式如下:
# For details see man 4 crontabs
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * command to be executed
每天 6:00 进行时间同步
注:/sbin/hwclock -w 同步BIOS时钟,强制把系统时间写入CMOS:当我们进行完 Linux 时间的校时后,还需要以 hwclock -w 来更新 BIOS 的时间,因为每次开机的时候,系统会重新由 BIOS 将时间读出来,所以, BIOS 才是重要的时间依据。
开机同步时间
- Linux服务器同步网络时间
- 设置linux服务器时间与网络同步
- Linux服务器时间同步
- Linux服务器时间同步
- Linux服务器同步时间
- Linux服务器时间同步
- linux服务器同步时间
- Linux 服务器时间同步
- Linux服务器时间同步
- Linux服务器时间同步
- linux 服务器时间同步
- linux 服务器时间同步
- Linux 服务器时间同步
- Linux同步时间服务器
- Linux服务器时间同步
- Linux 服务器时间同步
- linux服务器时间同步
- Linux服务器时间同步
- 随意瞎写点,作为博客重启吧
- 剑指offer——从尾到头打印链表
- Android Toolbar设置向上箭头,标题等
- 控件更新
- yarn 资源配置
- Linux服务器同步网络时间
- centos7 mysql数据库安装和配置
- Linux中切换用户变成-bash4.1-$的解决方法
- Ubuntu 安装JDK
- java:java.sql.SQLException:Underflow Exception trying to bind 4.9E-324
- 分治——Luogu1429 平面最近点对(加强版)
- c++ 中 stack和queue的使用方法
- c#手写识别相关问题
- Excel文件中核对两个工作表中不同内容