I think RRDtool (home page) might be usable for what you describe.
It is probably tailored to more regular sampling of data than I get the impression
that you need, but that should not be a problem.
Rrdtool is a round robin database that operates on a (configurable) fixed time period,
wrapping around and overwriting the oldest entries. If you rather want to save
everything (like I typically do) you can just use a period of several decades.
Even for sampling the sent/received number of bytes from a network card every 5th minute, the database is just 65Mb for 20 years.
You can use rrdtool by itself, but the real power of it is to use it in tandem with
MRTG (home page) which gives you dayly/weekly/monthly/yearly graphs of the activity you are monitoring. While MRTG primarily is written to capture/present network traffic you can monitor other more or less anything else as well things like for instance CPU/disk temperature (which is on my todo list of setting up).
There are also alternative graphing solutions not involving mrtg; if you search for "rrdtool disk temperature" you will find several.