2021-12-17

time synchronization script

# this script check several different ntp servers and exits when one succeeds... each site has multiple IP's.... requires ntpdate from ntp protocol, maybe in ntpd

/usr/sbin/ntpdate -u 0.us.pool.ntp.org && { echo good timesync; exit;}
/usr/sbin/ntpdate -u 0.north-america.pool.ntp.org && { echo good timesync; exit;}
/usr/sbin/ntpdate -u 1.north-america.pool.ntp.org && { echo good timesync; exit;}
/usr/sbin/ntpdate -u 2.north-america.pool.ntp.org && { echo good timesync; exit;}
/usr/sbin/ntpdate -u 0.us.pool.ntp.org && { echo good timesync; exit;}
/usr/sbin/ntpdate -u 1.us.pool.ntp.org && { echo good timesync; exit;}
/usr/sbin/ntpdate -u 2.us.pool.ntp.org && { echo good timesync; exit;}

No comments:

Post a Comment

Linux NetworkManager command line configuration

 Configure Network Settings Using Network Manager in Linux Last updated: March 25, 2025 Written by:baeldung Network ConfigurationNetworkMana...