dimarts, 2 de març del 2010

Sincronització hora a linux via ntp

A veure, els alumnes s'han queixat que el servidor on penja el moodle va un parell de minuts avançat, i per una altre banda, el servidor d'oracle resulta que estava sis hores retrasat. Solució, sincronitzar al el servidor de temps que tenim al centre pero que podia ser qualsevol màquina.
Donat que els servidors son debian hem d'instal·lar ntp i ntpdate

apt-get install ntp ntpdate

ntpdate -u 2.pool.ntp.org  

per sincronitzar-ho en hora amb servidors d'internet publics que apareix a  ntp.org

Fet.

Ara aprofito i connecto al servidor d'opensuse per fer el mateix procediment, servidor de referència horaria per provar en una altra distribució, poso la comanda ntpdate .... i em contesta que no ha de ser aquesta la comanda.

servidor:~ # ntpdate -u 2.pool.ntp.org
       !!!!!!!!!!!!!!  WARNING !!!!!!!!!!!!!!!!!!

The ntpdate program is deprecated and should not be used any more.  To
quote the upstream ntp developers:

  "The functionality ntpdate offered is now provided by the ntpd daemon
  itself.  If you call ntpd with the command line option -q it will
  retrieve the current time and set it accordingly."

Please check the Network Time Protocol (NTP) daemon man page and
  http://support.ntp.org/bin/view/Dev/DeprecatingNtpdate
for further information.

You can replace the ntpdate call with "rcntp ntptimeset" to achieve an
inital poll of the servers specified in /etc/ntp.conf.

The program /usr/sbin/sntp offers comparable functionality to ntpdate.
Specifically
  sntp -P no -r pool.ntp.org
is equivalent to
  ntpdate pool.ntp.org

Llavors he fet 

sntp -P no -r europe.pool.ntp.org
per opensuse