A sensor node that is sending measurement updates regarding some physical phenomenon to a destination is considered. The sensor relies on energy harvested from nature to transmit its updates, and is equipped with a finite B-sized battery to save its harvested energy. Energy recharges the battery incrementally in units, according to a Poisson process, and one update consumes one energy unit to reach the destination. The setting is online, where the energy arrival times are revealed causally after the energy is harvested. The goal is to update the destination in a timely manner, namely, such that the long term average age of information is minimized, subject to energy causality constraints. The age of information at a given time is defined as the time spent since the latest update has reached the destination. It is shown that the optimal update policy follows a renewal structure, where the inter-update times are independent, and the time durations between any two consecutive events of submitting an update and having k units of energy remaining in the battery are independent and identically distributed for a given κ ≤ B-1. The optimal renewal policy for the case of B=2 energy units is explicitly characterized, and it is shown that it has an energy-dependent threshold structure, where the sensor updates only if the age grows above a certain threshold that is a function of the amount of energy in its battery.