NTP - 校正 Linux 时间
NTP 可以让您与远端的时间服务器同步,以校正 Linux 系统的时间。
安装 NTP 模组
使用 APT 安装 NTP 套件:
apt-get install ntp
时间同步
执行下列指令即让系统时间与 time.stdtime.gov.tw 的时间同步:
ntpdate -s time.stdtime.gov.tw hwclock --systohc
每天对时
#! /bin/bash ntpdate -s time.stdtime.gov.tw hwclock --systohc
chmod 755 /etc/cron.daily/ntpdate.sh
No comments yet.