Update and write last run date only if necessary