[TriLUG] System question
Aaron S. Joyner
aaron at joyner.ws
Sun Apr 30 13:41:04 EDT 2006
Jason wrote:
>use ntpdate to set the date from a ntp server
>
>i.e. ntpdate pool.ntp.org
>
>Jason
>
>On Sat, Apr 29, 2006 at 03:59:02PM -0400, WA Brown
>wrote:
>
>
>>How can I change the system time while I am on ssh? I want to check the
>>system time on the server and maybe change it. How can I do it remotely
>>with ssh? I have an :
>>
>>Redhat 9
>>Apache 2.0 server
>>
>>
>>WA Brown
>>
>>
>>--
>>TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
>>TriLUG Organizational FAQ : http://trilug.org/faq/
>>TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
>>
>>
>
>
>
Since you seem to quesiton how to do it remotely, and you probably want
it to stick across reboots, I suspect you're really more intersted in
ensuring the hardware clock on the motherboard is corrected. You should
read the man page for `hwclock`, after which you will probably feel
compelled to run `hwclock --systohc`. Since you probably don't want to
do this on a regular basis, and it sounds like the machine has internet
access at least some of the time, you should probably see about running
ntpd, the Network Time Protocol Daemon, which will keep the current
clock in sync w/ the real time according to the outside world. You
should also check to see that your distribution runs hwclock --systohc
on shutdown and reboot (as most any modern distro probably does). You
may also wish to cron up this task, say perhaps once every day or wo,
such that when your system reboots it's sure to have a reasonably-sane
time before ntpd gets started and sets it to an accurate time.
Aaron S. Joyner
PS - As a side note to interested parties who go may read the hwclock
man page, don't use hwclock --adjust and ntpd together, as the drift
file ends up thinking the hwclock is perfect, which ruins the usefulness
of --adjust. ntpd is of course the preferable and more acurate way to
maintain the clock over a long period of time, hwclock --adjust is most
useful for those who don't have the luxury of internet access all the time.
More information about the TriLUG
mailing list