[beagleboard] RTC battery: set date automatically after boot

I obtained a VL1220 backup battery for the on-board RTC.
I figured out that I have to:
1) set the correct date and time via "date" command
2) save it to RTC: "hwclock -w –localtime"
3) after restart, restore it from RTC: "hwclock -s"

Is it possible to carry out those command automatically?
For example, if I issue "date command", can the system take care of
setting "hwclock"?

I am using Ubuntu 9.10


You can put this commands to rc.local and install NTP service too.

2010/4/19 Meereck <meereck@seznam.cz>