Skip to content

Instantly share code, notes, and snippets.

@vqiu
Created January 12, 2018 10:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save vqiu/a7300b004696564d4df76ce12f32e1b7 to your computer and use it in GitHub Desktop.
Save vqiu/a7300b004696564d4df76ce12f32e1b7 to your computer and use it in GitHub Desktop.
使用 rdate 替代ntp 功能

总有那么些蛋疼的机房,为了所谓的这安全,将NTP 服务器一刀切了。这时候时间同步就是一个问题,不过我们还可以使用 rdate 来解决。

yum -y install rdate
rdate -s time.nist.gov

cat > /etc/cron.daily/rdate << "EOF"
#!/bin/sh
rdate -s time.nist.gov
/sbin/hwclock --systohc
EOF

chmod +x /etc/cron.daily/rdate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment