Or you could store it locally as a backup in case your insert fails. Then put something in place to do a periodic clean up of your files.
One thing is certain. If you are dealing with data considered to be critical, you almost always keep it in two places.
Another suggestion could be to write these emails out to a file that would enable some sort of batch loading. Set up a naming convention for the batch file. When loading this batch into your database add a field to hold the name of the batch. Archive the batch file somewhere and once again perform some type of maintenance on your archives.
Regards,
Ian
gregg wrote:
I have a Perl cron job that reads emails off a pop server once a minute and stores them in a MySQL database on a remote machine. I logged onto the MySQL server today and performed a select * from messages where received > 20030322000000; Zero records were returned.
I did some more investigating and discovered that no records had been inserted in 4 days. I performed a "flush tables" (Someone suggested it, I don't know what it does) command and the records were still missing, but suddenly the Perl cron job on the other machine, without any changes, was populating the database with new records. The 4 days of messages are still simply lost.
Does anyone know what's going on here and how I can prevent this from happening again?
Thanks,
Gregg Allen
