Mustang65
Posts: 10
Joined: Fri Dec 06, 2013 2:20 am

Reset Pi time automatically without rebooting

Sun Oct 14, 2018 8:55 pm

I have a Pi3 in my RV running 24/7 with battery backup, so it should never need to reboot. The RV is in the mountains about 600 miles away from me, 6 months out of the year. The Pi tends to loose time each day and after a while it is giving me wrong times in my sensor dB. I do not have a RTC on it, which probably would have been the best way to go, but it is connected to the internet at the campground.

I would like to update the Pi's clock at least once a day automatically, without re-booting the Pi or dropping the internet connection. I looked around and was unable to locate anything that I could use with a batch process and chron. Does anyone have a solution for this project of mine, or point me in the direction that may have the script to accomplish this?
Thanks
Don

User avatar
DougieLawson
Posts: 39120
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Reset Pi time automatically without rebooting

Sun Oct 14, 2018 8:59 pm

Either replace timedatectl with NTP or restart timedatectl daily or fit a RTC hardware board.

At a distance adding a crontab to run sudo restart timesyncd is probably easiest for now.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Mustang65
Posts: 10
Joined: Fri Dec 06, 2013 2:20 am

Re: Reset Pi time automatically without rebooting

Sun Oct 14, 2018 9:02 pm

Thank you, I will give this a try and see what happens.
Don

Return to “General discussion”