Created
November 23, 2017 22:37
-
-
Save tonejito/5741a0924bdbc6c26b1f4f953de8557c to your computer and use it in GitHub Desktop.
Query periodically the first server listed on ntp.conf and update the time accordingly
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 characters
#!/bin/bash | |
# = ^ . ^ = | |
# 0755 root:root /etc/cron.hourly/rdate.cron | |
# | |
# Query periodically the first server listed on ntp.conf and update the time accordingly | |
( grep -m 1 '^server' /etc/ntp.conf | awk '{print $2}' | xargs -r rdate -n ) &>/dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment