Debian系统时间网络同步

来源:互联网 发布:java 打印所有参数 编辑:程序博客网 时间:2024/05/22 11:32

1.下载组件:

#apt-get install ntp ntpdate

 

2.编辑/etc/rc.local

#!/bin/sh -e

#

# rc.local

#

# This script is executed at the end of each multiuser runlevel.

# Make sure that the script will "exit 0" on success or any other

# value on error.

#

# In order to enable or disable this script just change the execution

# bits.

#

# By default this script does nothing.

 

/usr/sbin/ntpdate stdtime.gov.hk

 

exit 0

粗体为新添加内容!
原理分析:ntpdate在开机时运行一次,以后不再运行!ntp在开机时启动,会每隔一下段时间和ntpd服务器进行同步!

原创粉丝点击