0

I use my Pi as part of a home automation system, logging and carrying out events according to time. It is connected to a working internet connection, but let's say the power temporarily goes out and the Pi boots up faster than the router - is there a command line or Bash to run for example 5 mins later for the Pi (Raspbian Wheezy) to update the date from the time server again?

Renier Delport
  • 361
  • 1
  • 4
  • 12
  • Why not add a RTC like this one https://www.adafruit.com/products/264 Near the bootom of the page is a link describing how to use it with a PI. Also, take a look at this http://raspberrypi.stackexchange.com/questions/8231/how-to-force-ntpd-to-update-date-time-after-boot – Steve Robillard Apr 07 '16 at 06:40
  • @SteveRobillard it is already connected to in internet and I just need the time to sync early-ish after power failure. I prefer not to order additional hardware from overseas (delivery expenses). – Renier Delport Apr 07 '16 at 10:23

1 Answers1

1

Run ntpd in terminal - it's not too heavy a load and ensures your Pi's time is bang on all the time, RTC is good if you have no internet but ntpd is easy if you do...

Renier Delport
  • 361
  • 1
  • 4
  • 12
Mark Williams
  • 317
  • 3
  • 7
  • Thanks! "@reboot sudo ntp-wait" in cronfile works well for me. ntpd in terminal will also work, but not keep on trying if it fails. – Renier Delport Apr 07 '16 at 10:25