build snapshot file if needed