I am looking at a better solution for archiving large amounts of data over a date range. At the moment I am using a script that I created that creates a temporary table and inserts data into it using the following query:
INSERT INTO temp_candata SELECT * FROM candata WHERE timestamp between ‘2011-02-01 00:00:00’ and ‘2011-03-01 00:00:00’
Then I use mysqldump to dump the table, tar it and then delete it.
I know this method is not elegant or optimal. The time it takes to archive is much longer than I think it could be.
I had a quick look at mk-archiver but I am unsure of how to get the data from a specific date range.
Can anyone suggest a way I could do this?
Thanks in advance