Skip to content

Instantly share code, notes, and snippets.

@tonejito
Created November 23, 2017 22:37
Show Gist options
  • Save tonejito/5741a0924bdbc6c26b1f4f953de8557c to your computer and use it in GitHub Desktop.
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
#!/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