tip: synch BBB date via ssh

Just to share this little tip I discovered today.

Before connecting to your BBB with ssh, you can set the date with this command:

ssh root@beaglebone.local date $(date +%m%d%H%M%C%y)

Explanation: Connect to the remote computer and execute the command date giving as argument the current date of the local computer formatted as: month/day/hour/minute/century/year.

So, to keep things simpler, I made a little script, bbb.sh, on my path to connect to the BBB. It accepts an optional argument: date to synchronize before connection:

echo "Starting ssh on beaglebone.local"

if [ "$1" = "date" ]
     echo "Synching date:"
     ssh root@beaglebone.local date $(date +%m%d%H%M%C%y)
ssh root@beaglebone.local