OK I misunderstood.
Why not store all data in the database. It takes quite some time before you have a GB of data?
6 analog ports = 12 bytes per second = 1 MB/day + timestamp = 1.5 MB/day max.
For analysis you can use every 20th sample by adjusting your query.
SELECT * FROM samples WHERE seconds % 20 = 0;
sampling at the highest rate allows you to do analysis on every granularity afterwards.