title: What is the best way to run ntpdate at reboot, only after network is ready
body: <p>I'm using a BeagleBone, and since it has no built in RTC and battery back up, it loses the date on every reboot.  I can easily set the date with the command:</p>
  
  <p><strong>/usr/bin/ntpdate -b -s -u pool.ntp.org</strong></p>
  
  <p>But if the power goes out and back on for the house for example, then the time is lost.  The solution that comes with the latest beaglebone Angstrom linux distribution is to put a crontab line in that updates the time every half hour.  But I would prefer to just run the command once on powerup.  </p>
  
  <p>I tried putting this command listed above in crontab with the <strong>@reboot</strong> line, but that I believe ran before network was configured, or something else failed since it didn't get me the right time when I pulled the power for 5 minutes and put it back to the beaglebone.</p>
  
  <p>Is there some way to use ifconfig or something like that to run a script from init.d only after network is available?</p>