I'm planning to run a process that produces and saves data on an amazon ec2 micro spot instance. I read on their website that if the bidding price exceeds my maximum price my instance will be automatically terminated. How can I save the data before the instance terminates?
Regularly checkpoint your data to a data store that is external to the machine. An Amazon S3 bucket may be a strong candidate for that. Currently, there is no charge for data in, and the charge to post a new object every minute is very low ($.01 per 1,000 put requests).
Use a persistent EBS disk as your storage medium - it will function just like a regular volume, but will continue to exist beyond instance termination (note that the EBS root volumes are NOT persistent by default).
Depending on your specific setup, you may either keep all the data on the EBS volume, and each time you launch the instance, attach the EBS volume and continue processing data or you can use the EBS volume as temporary storage, saving data that has been fully processed to an external location (e.g. S3). Either way, EBS should be part of your setup to provide seamless continuation from where the last instance left off, and to provide the best data throughput.