Suggestion for 'sudo date' command for offline/standalone applications

I’ve been looking into setting up several raspberry shake and booms for offline applications because I plan to set them up in the field without any access to internet (but with GPS antenna for timing). I found an alternative way to set the time on the RShake&Boom unit to the one suggested on the online manual: https://manual.raspberryshake.org/no-network.html

Instead, I have been using the following command, from the local machine:

ssh myshake@rs.local "sudo date --set \"$(date)\"" 

This code seems to be effectively a one-line code for setting the UTC time on the Rshake unit without having to write out the full time. One caveat is that does assume the time on the local machine is correct.

Feel free to use this on the online manual, unless you think there is an issue with the suggested code. I have not had any problems with this code across several Rshake sensors.

2 Likes

Great suggestion. I added this to the manual: https://manual.raspberryshake.org/no-network.html

One thing to note here is that the date command in this example is parsed to a string before login, which means that it will be delayed for as long as it takes the user to log into the Shake. If the user is logging in manually, this means that the date will become stale during login. This effect can be nearly eliminated by setting up automatic SSH authentication (example here: http://linuxproblem.org/art_9.html).

1 Like