I have a few Linux servers for whatever reason are not keep correct time. They appear to fall behind every so many days so I am looking to create a fixlet to run whenever the time on these servers are more than 3 minutes behind or ahead. My thoughts are to just run this fixlet:
createfile until end
#!/bin/bash
/etc/init.d/ntp stop; ntpd -gq; /etc/init.d/ntpd start end
delete /root/ntprestart.sh
move __createfile /root/ntprestart.sh
run chmod 700 /root/ntprestart.sh
wait sh /root/ntprestart.sh
My problem is I can’t figure out how to create the relevance so the clients run when they are so many minutes ahead or behind.
Check out Fixlet ID 15 in BES Support (BES Clients Have Incorrect Clock Time) as a means to address this, or at least as an example approach leveraging the Root Server’s time as the comparison point.
Of course, if leveraging this approach, please be sure that the Root Server’s clock is accurate!!
So to shorten the time would I need to change
((now - apparent registration server time) > 1 * hour) or ((apparent registration server time - now) > 1 * hour)
to
((now - apparent registration server time) > 5 * minutes) or ((apparent registration server time - now) > 5 * minutes)
for a client that the time is drifted by 5 minutes?
I would probably use 15 minutes but just checking on correct use of syntax.