by Tim Hunt.
It would be worth looking at the time-stamps of the files that Moodle is deleting. Moodle should only be deleting files that are more than 7 days old, or something. How old are those files really? How old does Moodle think they are? Is that because the get the wrong time-stamp when they are written, or do they have the write time-stamp, but somehow Moodle does not see that?