Skip to content

Instantly share code, notes, and snippets.

@jay-johnson
Created March 9, 2017 22:19
Show Gist options
  • Save jay-johnson/e21e4eb2df711d340422e46503d91cde to your computer and use it in GitHub Desktop.
Save jay-johnson/e21e4eb2df711d340422e46503d91cde to your computer and use it in GitHub Desktop.
Cron job for syncing ntp - used when the install guides for ntp still do not work

Backing up a simple cron template I am using on a Fedora 24 machine that refuses to sync with ntp...This syncs it every 2 minutes:

# *    *    *    *    *  command to be executed
# ┬    ┬    ┬    ┬    ┬
# │    │    │    │    │
# │    │    │    │    │
# │    │    │    │    └───── day of week (0 - 7) (0 or 7 are Sunday, or use names)
# │    │    │    └────────── month (1 - 12)
# │    │    └─────────────── day of month (1 - 31)
# │    └──────────────────── hour (0 - 23)
# └───────────────────────── min (0 - 59)

# Log Rotation Crons
#
# Force the rotation:
# 11     *    *    *    * /usr/sbin/logrotate -f /etc/logrotate.conf >/dev/null 2>&1

# Sync the ntp time
*/2    *    *    *    * /sbin/ntpdate -q 0.rhel.pool.ntp.org >> /tmp/testdate.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment