I've done a little poking around using Reflector and I think I have
found the problem.
The DeleteBuildsOlderThanXDays method is using the Creation Date/Time
of a file to determine whether or not to delete it. The statistics
file was created back in January so it was deleted - even though it
was modfied during the build process.
private void DeleteBuildsOlderThanXDays(string buildLogFolder, int
daysToKeep)
{
this.SetFilesToNormalAttribute(buildLogFolder);
foreach (string str in Directory.GetFiles(buildLogFolder))
{
if (File.GetCreationTime(str).Date < DateTime.Now.Date.AddDays
((double) -daysToKeep))
{
File.Delete(str);
}
}
}
I'll look at raising this as a bug and see how we go.
Cheers
On Jul 20, 11:44 am, DilbertDave <[email protected]> wrote:
> Our Network Admin was recently moaning about a lack of space on the
> servers so I took a look at the artifactcleanup publisher to allow
> CCNet to keep its house in order.
>
> I started with the KeepLastXBuilds option and it did exactly what it
> said on the tin. The problem arose when I decided to use
> DeleteBuildsOlderThanXDays instead - because I wanted to retain about
> 2 weeks of history for the dashboard and could not be sure how many
> builds this would be.
>
> When the integration ran it duly removed all the log files older than
> the 20 days that I specified but also removed the report.xml and
> statistics.csv files as well - losing about 6 months of stats.
> Now these are not vital to us (so they were not backed up) but it's a
> little annoying to lose them.
>
> The question is, why did this option remove the statistics file? Is it
> supposed to or is this a bug?
>
> Thanks in Advance