Energy harvesting has been extensively used to allow for long-term and unattended operation of nodes in large-scale distributed systems. However, the smaller the relative rechargeable energy storage of the harvesting system, the higher is the sensitivity of its operation to short-term non-deterministic changes of the harvested power or the current power demand. A reliable and predictable node operation can be achieved with an additional backup battery. First commercial products that allow for an efficient energy exchange between energy harvester, backup battery and energy consumer are available. But, there are no energy management algorithms that optimize the longterm node utility while maximizing the lifetime of the node in terms of its backup battery. We formally model the problem, provide an optimal solution for a class of node utility functions, and implement the strategy on a resource-constrained hardware. Extensive simulations as well as experiments on indoor solar data traces show the accuracy of the abstract model, the run-time overhead and efficiency of our approach.