zoukankan      html  css  js  c++  java
  • linux用rdate命令实现同步时间

    用rdate命令实现同步时间

    前两天说到用ntp时间服务器和ntpdate命令同步时间,今天简单记录下用rdate同步时间

    http://blog.csdn.net/wyzxg/archive/2010/05/06/5561548.aspx

    在各种linux中都有rdate命令

    //RHEL5

    1. 选在一台linux作为master,然后启动上面的时钟服务

    #chkconfig time on

    如果不启动这个服务,在client运行rdate同步时间时会报错的

    rdate: couldn't connect to host 192.168.2.31: Connection refused

    //RHEL6

    1. rdate Serve install xinetd.rpm download from (http://rpmfind.net/linux/rpm2html/search.php?query=xinetd)

    1.先安装xinetd : sudo yum install -y xinetd

    2.修改/etc/xinetd.d/time-stream, 修改:

    disable    = yes  改为

    disable = no

    3.启动xinetd

    service xinetd start

    这样其它机器就可以通过rdate 与该机器进行时间同步

    rdate -s ip

    2. 在client上执行

    #rdate –s 192.168.2.31

    这样就把远程的192.168.2.31的时间同步到本地了啊

    也可以做成定时任务,如下所示:

    [root@rac1 tmp]# crontab -l

    */2 * * * * rdate -s rac2

    说明:rdate命令时间同步的方法要简单些,也没有ntpdate时间精确。就不介绍了啊

  • 相关阅读:
    raw socket
    selenium and win32api
    linux ip
    network config
    grub paramiter & menu.list
    实用命令dd
    resin or tomcat .war e.g. note
    JSP 运行
    linux command screen
    docker interact example
  • 原文地址:https://www.cnblogs.com/jackydalong/p/4057308.html
Copyright © 2011-2022 走看看