I am using ntpdate to update the time. If there is no internet connection or the NTP server is down, ntpdate fails, but ntpdate takes a long time to exit (approximately 20 to 23 seconds). I read the manual of ntpdate and I see -t timeout option.
-t timeout Specify the maximum time waiting for a server response as the value timeout, in seconds and fraction. The value is rounded to a multiple of 0.2 seconds. The default is 1 second, a value suitable for polling across a LAN.
I thought to try this option but it is taking the same amount of time to exit. I thought if we specify timeout then ntpdate will exit within specified seconds. I used the command like this
ntpdate -u -t 10 <ip>
Did anyone try the timeout option in ntpdate?