一区二区三区日韩精品-日韩经典一区二区三区-五月激情综合丁香婷婷-欧美精品中文字幕专区

分享

linux下日期時(shí)間自動(dòng)同步設(shè)置(rdate,ntpdate兩種方法)

 智慧書(shū)倉(cāng) 2019-05-23

http://blog./archives/6397.html

linux下同步時(shí)間,至少有兩種方法:

rdate,ntpdate兩種。centos最小化安裝默認(rèn)不安裝,先確認(rèn)已經(jīng)安裝過(guò),否則先安裝。

其中rdate本身是用來(lái)獲取遠(yuǎn)程時(shí)間服務(wù)器上時(shí)間用的,帶上 -s 參數(shù),就可以將獲取到的時(shí)間應(yīng)用到本地系統(tǒng)。

NAME
       rdate - get the time via the network

SYNOPSIS
       rdate [-p] [-s] [-u] [-l] [-t sec] [host...]

DESCRIPTION
       rdate  connects  to  an  RFC  868 time server over a TCP/IP network, printing the returned time
       and/or setting the system clock.

   OPTIONS
       -p     Print the time returned by the remote machine.

       -s     Set the system time to the returned time.

       -u     Use UDP instead of TCP as the transport.

       -l     Use syslog to output errors (cron.warning) and output (cron.info).

       -t     Set timeout in seconds for every attempt to retreive date.

rdate -s time.nist.gov

ntpdate 本身就是用來(lái)同步時(shí)間的工具。

示例 :ntpdate ntp.sjtu.edu.cn

NAME
       ntpdate - set the date and time via NTP

       Disclaimer:  The functionality of this program is now available in the ntpd program. See the -q com-
       mand line option in the ntpd - Network Time Protocol (NTP) daemon page. After a suitable  period  of
       mourning, the ntpdate program is to be retired from this distribution

SYNOPSIS
       ntpdate [ -46bBdqsuv ] [ -a key ] [ -e authdelay ] [ -k keyfile ] [ -o version ] [ -p samples ] [ -t
       timeout ] [ -U user_name ] server [ ... ]

DESCRIPTION

[略,具體參看linux man手冊(cè)]

日期時(shí)間服務(wù)器

同步時(shí)間,就必須有時(shí)間服務(wù)器。通常情況下,我們完全沒(méi)必要自己搭建,使用公共的時(shí)間服務(wù)就可以。

參看 國(guó)內(nèi)常用NTP服務(wù)器地址及IP  http://www.douban.com/note/171309770/

其中國(guó)家授時(shí)中心的似乎不能用,推薦使用上海交大ntp服務(wù) ntp.sjtu.edu.cn 或美國(guó)授時(shí)中心 time.nist.gov

上代碼,拷了就可以用

rdate -s time.nist.gov

ntpdate ntp.sjtu.edu.cn

可以加到crontab里定時(shí)執(zhí)行。

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買(mǎi)等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類(lèi)似文章 更多

    欧美日韩一区二区综合| 有坂深雪中文字幕亚洲中文| 在线观看那种视频你懂的| 国产免费无遮挡精品视频| 亚洲欧美日韩在线看片| 亚洲国产天堂av成人在线播放| 欧美精品中文字幕亚洲| 久久成人国产欧美精品一区二区| 高清不卡视频在线观看| 亚洲中文字幕高清乱码毛片| 国产中文字幕一二三区| 九九热视频免费在线视频| 五月天综合网五月天综合网| 国产精品刮毛视频不卡| 亚洲一区二区久久观看| 风间中文字幕亚洲一区| 91亚洲精品亚洲国产| 日本午夜乱色视频在线观看| 亚洲一区二区福利在线| 国产亚洲欧美日韩精品一区| 亚洲熟妇av一区二区三区色堂| 亚洲专区中文字幕在线| 日韩成人动作片在线观看| 成人精品一级特黄大片| 国产av大片一区二区三区| 不卡中文字幕在线免费看| 国产色偷丝袜麻豆亚洲| 九九热精彩视频在线免费| 国产午夜免费在线视频| 亚洲午夜精品视频观看| 不卡一区二区高清视频| 成人三级视频在线观看不卡| 久久热在线视频免费观看| 久久精品久久精品中文字幕| 国产精品免费福利在线| 欧美日韩国产另类一区二区| 精品欧美在线观看国产| 久久99青青精品免费| 99久久精品一区二区国产| 精品国模一区二区三区欧美| 国产综合一区二区三区av|