On 2017-03-07 09:02, Per Jessen wrote:
/usr/sbin/ntpd -g -q
Let's try. The effective call is: /usr/sbin/ntpd -g -q 0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org The result is: minas-tirith:~ # /etc/cron.hourly/mine-clocksync 7 Mar 13:25:18 ntpd[4023]: ntpd 4.2.8p9@1.3265-o Mon Dec 19 17:18:26 UTC 2016 (1): Starting 7 Mar 13:25:18 ntpd[4023]: Command line: /usr/sbin/ntpd -g -q 0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org 7 Mar 13:25:18 ntpd[4023]: proto: precision = 0.559 usec (-21) authreadkeys: full access list <NULL> 7 Mar 13:25:18 ntpd[4023]: switching logging to file /var/log/ntp 7 Mar 13:25:18 ntpd[4023]: Listen and drop on 0 v6wildcard [::]:123 7 Mar 13:25:18 ntpd[4023]: Listen and drop on 1 v4wildcard 0.0.0.0:123 7 Mar 13:25:18 ntpd[4023]: Listen normally on 2 lo 127.0.0.1:123 7 Mar 13:25:18 ntpd[4023]: Listen normally on 3 wlan0 192.168.1.129:123 7 Mar 13:25:18 ntpd[4023]: Listen normally on 4 lo [::1]:123 7 Mar 13:25:18 ntpd[4023]: Listen normally on 5 wlan0 [fe80::eee:e6ff:fed7:bb5f%3]:123 7 Mar 13:25:18 ntpd[4023]: Listening on routing socket on fd #22 for interface updates 7 Mar 13:25:18 ntpd[4023]: 0.0.0.0 c016 06 restart 7 Mar 13:25:18 ntpd[4023]: DNS 0.pool.ntp.org -> 193.145.15.15 7 Mar 13:25:18 ntpd[4023]: DNS 1.pool.ntp.org -> 158.227.98.15 7 Mar 13:25:18 ntpd[4023]: DNS 2.pool.ntp.org -> 81.19.96.148 7 Mar 13:25:18 ntpd[4023]: DNS 3.pool.ntp.org -> 213.251.52.234 7 Mar 13:25:18 ntpd[4023]: DNS 0.pool.ntp.org -> 158.227.98.15 7 Mar 13:25:18 ntpd[4023]: DNS 1.pool.ntp.org -> 193.145.15.15 7 Mar 13:25:18 ntpd[4023]: DNS 2.pool.ntp.org -> 158.227.98.15 7 Mar 13:25:18 ntpd[4023]: DNS 3.pool.ntp.org -> 81.19.96.148 7 Mar 13:25:19 ntpd[4023]: DNS 0.ch.pool.ntp.org -> 195.186.4.100 7 Mar 13:25:19 ntpd[4023]: DNS 1.ch.pool.ntp.org -> 212.51.144.44 7 Mar 13:25:19 ntpd[4023]: DNS 0.fr.pool.ntp.org -> 95.81.173.8 7 Mar 13:25:19 ntpd[4023]: DNS 0.uk.pool.ntp.org -> 80.87.131.131 7 Mar 13:25:19 ntpd[4023]: DNS 0.es.pool.ntp.org -> 81.19.96.148 7 Mar 13:25:19 ntpd[4023]: DNS Isengard.valinor -> 192.168.1.16 7 Mar 13:25:40 ntpd[4023]: ntpd: time set +15.161791 s ntpd: time set +15.161791s minas-tirith:~ # Instead of using the servers in the command line, it is using those in the ntp.conf file. Nod bad in itself, but unexpected. So I can instead not provide any server in the command line, I like that. My script is now, taking ideas from everybody that posted: #!/bin/sh LOGGER=/usr/bin/logger FACILIDAD=user.notice TAG=my_hourly_clocksync $LOGGER -t $TAG -p $FACILIDAD "Going to sync time now." #/usr/sbin/rcntp ntptimeset #Does not exist in Leap. /usr/sbin/ntpd -g -q ERR=$? # set hardware clock also in case of reboot if [ $ERR -eq 0 ] then /usr/sbin/hwclock -w echo echo "set hardware clock also in case of reboot" fi $LOGGER -t $TAG -p $FACILIDAD "Time should now be synced." -- Cheers / Saludos, Carlos E. R. (from 42.2 x86_64 "Malachite" (Minas Tirith))