Open Danrancan opened 2 years ago
What Ive done is first set the time from the internet with one of these
sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z"
sudo date +"%d %b %Y %T %Z" -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep '^ Date:' | cut -d' ' -f 5-)"
sudo date +"%d %b %Y %T %Z" -s "$(curl -s --head google.com | grep '^Date:' | cut -d' ' -f 3-)"
then add this into crontab -e
to set the time on every reboot
@reboot /usr/bin/python3 /home/pi/USB-RTC/Set_Time_Boot.py
I just bought this device online. I am running a lemp server on my raspberry pi. After restarting the pi and when it is offline, it's logs timestamps become innaccurate since the raspberry pi doesn't have an internal rtc. My goal was to buy this RTC in case my internet crashed, but I needed accurate timestamps on my Pi's log files. I am VERY confused by the instructions here. Is it possible to make ubuntu server 20.04 on raspberry pi use this as the default RTC, to keep accurate logs and timestamps while offline? And if so, how? What exactly must I do after installation? I am even having issues just setting the clock let alone forcing the pi to use this clock as the default rtc.
Please let me know where I can start in accomplishing this task. If you help me, I will certainly provide a contribution to your git repo in the form of a tutorial for other users of this product. Thank you!