1

It's a remote server so no GUI or fancy stuff installed, I connect to that host using SSH. For security reasons I suppose, I cannot use the 'date -s' command to change the local server's current time.

$ cat /etc/issues ==> Ubuntu 10.04 LTS
$ uname -r ==> 2.6.32-042stab037.1
$ cat $SHELL ==> /bin/bash

'date' shows me time that is about 10 minutes early, I tried linking the right time from /usr/share/zoneinfo (New york in my case) to /etc/localtime, but nothing really changed, my clock is still 10 minutes unsynchronized.

Do I have to generate a new time zone binary using zic? Yes? how? no? What else could I try ?

Thanks a bunch in advance. /s

Taher
  • 11,902
  • 2
  • 28
  • 44

2 Answers2

3

Did you think about installing a ntp daemon to keep your time synchronized to avoid those time slicing ? Ntpd is a good starting point (it is provided in debian packages ntp and openntpd)

You'll have to set a server reference (usually ntp.pool.org, but you can change it if you need) and then, launch it on machine startup.... and let him do the job (ie : keep the time synchronized)

Cédric Julien
  • 78,516
  • 15
  • 127
  • 132
  • sudo ntpdate -u [server] results in "Operation not permitted". – Taher Dec 19 '11 at 15:08
  • 1
    ntpdate is NOT the same thing as using the ntp daemon. You need to turn on the ntp service, and define a time server. Besides which using date or ntpdate can really screw up OS-time related things when the system is off substantially. – jim mcnamara Dec 19 '11 at 18:35
3

Use adjtimex(8) to set the system clock of a running system. It will smoothly adjust the time and not leave any scary gaps as date would. The syntax for using it is quite beyond me, however, so I just use ntp and forget it.

If your clock issues persists accross reboots you will need to reset the hardware clock with hwclock as well.

sorpigal
  • 25,504
  • 8
  • 57
  • 75