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

Script to see network interface connection speed

cat network-speed #!/usr/bin/bash # ethtool enp2s0 | grep Speed ethtool $1 | grep Speed # mii-tool -v enp2s0 mii-tool -v $1   network-speed ...