Skip to content

Instantly share code, notes, and snippets.

@nick-jonas
Created May 12, 2017 18:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nick-jonas/1e959f0f3f6a25a99f1851e6148291c1 to your computer and use it in GitHub Desktop.
Save nick-jonas/1e959f0f3f6a25a99f1851e6148291c1 to your computer and use it in GitHub Desktop.
Place this snippet in your /etc/rc.local file so an RPI will sync time on boot
#!/bin/sh
#force time set with NTP server
clear
echo Setting the time and date. Your sudo password may be required below...
echo
sudo ntpdate -bu pool.ntp.org
echo
echo The time and date are now set to `date`
echo
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment