Don't use a timer for 30 days period. That's too much. You should instead set the timer to tick every hour or so and count the ticks. This will allow you to save the current state in the EEPROM (every tick) and make the solution function even if the MCU is reset.