Created
November 21, 2018 03:24
Revisions
-
logikal created this gist
Nov 21, 2018 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ #!/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"