Created
November 21, 2018 03:24
-
-
Save logikal/26449734b8d9e07e47f7cf87dc0189c9 to your computer and use it in GitHub Desktop.
Ever wondered how far off your clock was? now you can know.
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
#!/usr/bin/env bash | |
# finds the maximum clock drift in the last 30 days | |
# using the stats files kept in /var/log/ntpstats | |
# We need somewhere temporary to keep our concatenated results | |
TMPFILE=$(mktemp) || exit 1 | |
FILELIST=$(find /var/log/ntpstats/ -mtime -31 -type f) | |
cut -d' ' -f 5 $FILELIST| sort -g > $TMPFILE | |
MIN_OFFSET=$(head -n 1 $TMPFILE) | |
MAX_OFFSET=$(tail -n 1 $TMPFILE) | |
echo "$MIN_OFFSET $MAX_OFFSET" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment