Is there any way I can stop the Arduino Mega 2560 from resetting all variables after losing and reconnecting power? I am using an Arduino Mega 2560 board. I have tried connecting a 115 &Omega; resistor from 5V to Reset, and 10 &micro;f capacitor form reset to GND (to disable autoreset), and the variables still seem to reset themselves when I unplug and replug-in the Arduino. Any way to stop this from happening?

Basically I am making a device that is sensitive to time, and must run for about 2 months, but if it is unplugged, it can't lose its place in time and reset the whole program. 

I think one alternative would be for me to have it actually write how long it has been running into a .txt file on the microSD card and then verify that in the start-up... 

Any ideas?
Save the variables you need to EEPROM.