Moxa W321-LX [34/80] Adjusting the system time

Moxa W341-LX [34/80] Adjusting the system time
W321/341 Linux Managing Embedded Linux
3-8
#rm –f /etc/rc.d/rc3.d/S60tcps2
Adjusting the System Time
Setting the Time Manually
The W321/341 have two time settings. One is the system time, and the other is the RTC (Real Time
Clock) time kept by the W321/341s hardware. Use the #date command to query the current system
time or set a new system time. Use #hwclock to query the current RTC time or set a new RTC time.
Use the following command to query the system time:
#date
Use the following command to query the RTC time:
#hwclock
Use the following command to set the system time:
#date MMDDhhmmYYYY
MM = Month
DD = Date
hhmm = hour and minute
YYYY = Year
Use the following command to set the RTC time:
#hwclock –w
Write current system time to RTC
The following figure illustrates how to update thesystem time and set the RTC time.
192.168.3.127 - PuTTY
root@Moxa:~# date
Fri Jun 23 23:30:31 CST 2000
root@Moxa:~# hwclock
Fri Jun 23 23:30:35 2000 -0.557748 seconds
root@Moxa:~# date 120910002004
Thu Dec 9 10:00:00 CST 2004
root@Moxa:~# hwclock –w
root@Moxa:~# date ; hwclock
Thu Dec 9 10:01:07 CST 2004
Thu Dec 9 10:01:08 2004 -0.933547 seconds
root@Moxa:~#
NTP Client
The W321/341 have a built-in NTP (Network Time Protocol) client that is used to initialize a time request
to a remote NTP server. Use #ntpdate <this client utility> to update the system time.
#ntpdate 192.168.1.97
#hwclock –w

Содержание

Похожие устройства

Скачать
Случайные обсуждения