DHCP y crontab NTP
Hola a todos! Un placer volver por estos lares :)
Tengo un DHCP montado en clúster. La idea es que el DHCP1 ejecute en crontab el comando 'ntpdate' para sincronizarse con un reloj atómico. En teoría el DHCP2 se sincronizaría con el DHCP1. Bien, me da este error:
#cat /var/spool/mail/root
From root@localhost.localdomain Fri Nov 11 12:23:42 2011
Return-Path:
Received: from localhost.localdomain (DHCP1 [127.0.0.1])
for ; Fri, 11 Nov 2011 12:23:42 +0100
Received: (from root@localhost)
by localhost.localdomain Sat, 5 Nov 2011 09:03:02 +0100
Date: Sat, 5 Nov 2011 09:03:02 +0100
Message-Id:
From: root@localhost.localdomain (Cron Daemon)
To: root@localhost.localdomain
Subject: Cron ntpdate -u 0.europe.pool.ntp.org
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
/bin/sh: ntpdate: command not found
Lo listado en 'crontab':
DHCP1# crontab -l
*/1 * * * * scp /etc/dhcpd.conf.master server2:/etc/dhcpd.conf.master
*/3 * * * * ntpdate -u 0.europe.pool.ntp.org
Lo que tiene el fichero:
DHCP1# cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
Poniendo /usr/sbin/ntpdate -u 0.europe.pool.ntp.org no me salta el aviso de "You have new mail in /var/spool/mail/root".
El problema es que este error no me lo suelta en el DHCP2 teniendo el mismo comando definido en el crontab:
DHCP2# crontab -l
*/3 * * * * ntpdate -u 0.europe.pool.ntp.org
El fichero '/etc/crontab' es exactemente igual en ambos DHCPx.
Si lanzo el comando 'ntpdate bla.ntp.bla' no hay problema, el aviso me sale cuando se ejecuta desde crontab.
Alguna idea de cómo solucionarlo para que ambos queden igual? Qué hago mal o qué me falta por modificar?
Saludos
- Inicie sesión o regístrese para enviar comentarios
- 200 lecturas


tienes esto: */3 * * * * ntpdate -u 0.europe.pool.ntp.org
prueba esto */3 * * * * /usr/bin/ntpdate -u 0.europe.pool.ntp.org
o donde se encuentre el comando /bin/ /sbin/ etc. pero con el path completo.