Ciao!
Per sincronizzare l'ora ho inserito il comando ntpdate nel cron:
crontab -e
00 * * * * root /etc/init.d/ntpdate start 2>&1 > /dev/null
Questo è /etc/init.d/ntpdate
codice:
#! /bin/sh
test -f /usr/sbin/ntpdate || exit 0
test -f /etc/default/ntp-servers || exit 0
. /etc/default/ntp-servers
test -n "$NTPSERVERS" || exit 0
case "$1" in
start|restart|force-reload)
/usr/sbin/ntpdate -u -b -s $NTPSERVERS
hwclock --systohc
;;
stop)
;;
*)
echo "Usage: /etc/init.d/ntpdate {start|stop|restart|force-reload}"
exit 1
esac
exit 0
Se lancio manualmente
#/etc/init.d/ntpdate start 2>&1 > /dev/null
l'ora mi viene aggiornata.
Quando invece parte da solo non aggiorna. Nel file di log ho la prova che il comando sia partito:
Feb 8 11:00:01 riccione /USR/SBIN/CRON[25254]: (root) CMD (root /etc/init.d/ntpdate start 2>&1 > /dev/null)
...ma forse non correttamente?
Grazie
Ciao