Vixual / 106 posts / tags / 31 comments / feed / comments feed /
Search:

NTP - 校正 Linux 時間

NTP 可以讓您與遠端的時間伺服器同步,以校正 Linux 系統的時間。

安裝 NTP 模組

使用 APT 安裝 NTP 套件:

apt-get install ntp

時間同步

執行下列指令即讓系統時間與 time.stdtime.gov.tw 的時間同步:

ntpdate -s time.stdtime.gov.tw
hwclock --systohc

每天對時

  • 若要設定每天執行一次,可於 /etc/cron.daily 新增指令檔 “ntpdate.sh”,內容如下:
  • #! /bin/bash
    ntpdate -s time.stdtime.gov.tw
    hwclock --systohc
  • 更改檔案屬性為 755:
  • chmod 755 /etc/cron.daily/ntpdate.sh
    收藏至網路書籤: These icons link to social bookmarking sites where readers can share and discover new web pages.
    • del.icio.us
    • Google
    • Live
    • YahooMyWeb
    • MyShare
    • Hemidemi
    • Funp

    您可能會對以下這些文章感興趣

    您對這篇文章的評價:
    1 Star2 Stars3 Stars4 Stars5 Stars (請給予評價)
    Loading ... Loading ...

    沒有任何留言

    發表您的評論

    (您的留言會在審核後才能公開)