User`s manual
TC-6110 Linux User's Manual Basic Platform Configuration
2-5
user@remoteDebian-moxa@Moxa:~# ssh 192.168.3.127
The authenticity of host ‘192.168.3.127 (192.168.3.127)’ can’t be established.
RSA key fingerprint is 8b:ee:ff:84:41:25:fc:cd:2a:f2:92:8f:cb:1f:6b:2f.
When asked if you want to continue connecting over SSH, answer yes by typing Y, y, or yes.
Are you sure you want to continue connection (yes/no)? yes_
Setting the System Clock and the RTC
The TC-6110-LX uses two clocks to keep time; one is the system time, and the other is the time provided by
the RTC (Real Time Clock) built into the TC-6110’s hardware. The system clock is set using the date command,
and the RTC is set using the hwclock command.
NTP Client
It is not usually necessary to set the clocks manually, though it is necessary to configure them when first
setting up the system. The TC-6110-LX comes with a built-in Network Time Protocol (NTP) client that can
access remote NTP servers to synchronize your system clock to worldwide reference clocks. To resynchronize
the system time to a remote reference clock, use the ntpdate command:
moxa@MOXA:~#sudo ntpdate time.stdtime.gov.tw
Next, the RTC may be set by using the hwclock command:
moxa@MOXA:~#sudo hwclock –w
moxa@MOXA:~# date ; sudo hwclock
Wed Dec 16 16:36:12 CST 2009
Wed 16 Dec 2009 03:38:13 AM CST -0.016751 seconds
moxa@MOXA:~#
moxa@MOXA:~# sudo ntpdate time.stdtime.gov.tw
16 Dec 03:49:48 ntpdate[2510]: step time server 220.130.158.52 offset
155905087.9
84256 sec
moxa@MOXA:~#
moxa@MOXA:~# sudo hwclock -w
moxa@MOXA:~# date ; sudo hwclock
Wed Dec 16 03:51:07 CST 2009
Wed 16 Dec 2009 03:51:07 AM CST -0.016771 seconds
ATTENTION
Before using the NTP client utility, c
heck your IP address and network settings (gateway and DNS) to make
sure an Internet connection is available.
You may visit the Network Time Protocol project’s home page
http://www.ntp.org
(Oct, 2013) for more information about NTP.
Using a Shell Script for Automatic Updates
As the RTC gets older, it may start to run slow and fail to accurately track time. This section provides one
example of how a shell script may be used to repeatedly synchronize the RTC to the system clock by using the
Liinux initialization table (inittab). Because the system clock will be automatically synched using NTP, the two
clocks will reliably keep time. Other methods are also available, for instance using cron (shown below, in the
section Cron for Executing Scheduled Commands) or using the at command. Below, we show you how to
write a simple shell script for keeping the two clocks synchronized, and show you how to set the system to
continuously run the script in the background, across re-boots.