Keep a copy of previous file before overwriting it with new one upon generation