Linux配置自动时间同步
2014-04-10 09:39
169 查看
时间同步命令:
ntpdata time.windows.com
自动时间同步:
需要配置/etc/crontab文件,实现自动执行任务
让linux从time.windows.com自动同步时间
vi /etc/crontab
加上一句:
00 0 1 * * root ntpdate -s time.windows.com
time.nist.gov 是一个时间服务器.
Linux时间服务器配置(192.168.10.1)
1). # rpm -ivh ntp-4.1.2-4.EL3.1.i386.rpm
2). # vi /etc/ntp.conf
注释一行
restrict default ignore
加入一行
restrict 192.168.10.0 mask 255.255.255.0 notrust nomodify notrap
3). # vi /etc/ntp/step-tickers
加入一行
pool.ntp.org
这样每次ntpd启动时,会自动连接该国际标准时间服务器;
4). # service ntpd start
5). # netstat -an |grep 123
确保该端口以udp方式开放
时间客户端配置(192.168.10.2)
1). # ntpdate 192.168.10.2
应该显示同步成功
2). # crond -e
加入
0-59/10 * * * * /usr/sbin/ntpdate 192.168.10.1
表示每隔10分钟同步一次时间
ntpdata time.windows.com
自动时间同步:
需要配置/etc/crontab文件,实现自动执行任务
让linux从time.windows.com自动同步时间
vi /etc/crontab
加上一句:
00 0 1 * * root ntpdate -s time.windows.com
time.nist.gov 是一个时间服务器.
Linux时间服务器配置(192.168.10.1)
1). # rpm -ivh ntp-4.1.2-4.EL3.1.i386.rpm
2). # vi /etc/ntp.conf
注释一行
restrict default ignore
加入一行
restrict 192.168.10.0 mask 255.255.255.0 notrust nomodify notrap
3). # vi /etc/ntp/step-tickers
加入一行
pool.ntp.org
这样每次ntpd启动时,会自动连接该国际标准时间服务器;
4). # service ntpd start
5). # netstat -an |grep 123
确保该端口以udp方式开放
时间客户端配置(192.168.10.2)
1). # ntpdate 192.168.10.2
应该显示同步成功
2). # crond -e
加入
0-59/10 * * * * /usr/sbin/ntpdate 192.168.10.1
表示每隔10分钟同步一次时间
相关文章推荐
- Linux配置自动时间同步
- Linux配置自动时间同步
- Linux 时间同步配置
- Linux下MySQL的主从热备(自动同步)配置
- linux时间是如何自动同步的
- 自动调整linux系统时间和时区与Internet时间同步
- Linux 时间同步配置
- linux时间同步配置
- linux自动同步时间的方法
- linux NTP 配置时间同步
- Linux 修改时间,时区和设置时间自动同步
- linux 时间自动同步
- linux 局域网的时间同步配置
- Linux 时间同步配置
- LInux下可以使用命令自动与网络的NTP服务器同步时间 CSDN验证码验证失败问题解决
- linux NTP 配置时间同步
- 关于linux下ntp时间同步服务的安装与配置
- Linux 时间同步配置
- Linux 时间同步配置
- Linux 自动同步时间