Synchronize date and time on remote board via ssh


If you have a board without a battery then you might want to synchronize a date and time with your computer.


$ DATE=`date` ;  ssh root@192.168.2.2 "TZ=America/Chicago date --set '$DATE' " ; echo "local: ";  date ;  echo "remote: " ;  ssh root@192.168.2.2 " TZ=America/Chicago date  " 
Mon Jun  9 14:04:16 CDT 2014 
local: 
Mon Jun  9 14:04:16 CDT 2014 
remote: 
Mon Jun  9 14:04:16 CDT 2014
Note that output for Mac is CST and for Linux is UTC.





As an Amazon Associate I earn from qualifying purchases.

My favorite quotations..


“A man should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.”  by Robert A. Heinlein

"We are but habits and memories we chose to carry along." ~ Uki D. Lucas


Popular Recent Articles