Last active
February 22, 2024 04:31
-
-
Save sean-smith/3288d8f3f0f1a293036d9f8e3ac3c9a1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# run as root, then validate with: | |
# chronyc sources -v | |
# chronyc tracking | |
# see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/set-time.html#configure-time-sync | |
apt install -y chrony | |
sed -i '/\# See http:\/\/www.pool.ntp.org\/join.html for more information./a server 169.254.169.123 prefer iburst minpoll 4 maxpoll 4\npool time.aws.com iburst' /etc/chrony/chrony.conf | |
systemctl enable --now chrony | |
/etc/init.d/chrony restart |
To use Amazon Time Sync Service:
sed -i '/\# See http:\/\/www.pool.ntp.org\/join.html for more information./a server 169.254.169.123 prefer iburst minpoll 4 maxpoll 4\npool time.aws.com iburst' /etc/chrony/chrony.conf
Instead of start
, do systemctl enable --now chrony
.
Updated, thanks @verdimrc
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Validate with: