Rather than deleting the file, let's just keep it. Instead, write to a new and different file with the digits of the changing month and year.

Code:
ALIAS -l StatsFile return monthlystats- $+ $asctime(yyyy-mm) $+ .txt

On *:Event: {
  write $StatsFile some statistic
}

You will merely accumulate more and more files at a manageable rate.

monthlystats-2018-11.txt
monthlystats-2018-12.txt
monthlystats-2019-01.txt

etc.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!