We set up a test copy of our Moodle server. The troubleshooting steps we followed were:
- Disable scheduled task which runs the cron job
- Move the files that were left in the trashdir folder when we last experienced this problem back to the trashdir folder
- Change run time of 'Cleanup files in trash' scheduled task to run in 5 minutes
- Change system date to 4 days ahead
- Run cron job from CLI
It was at this point we were hoping to replicate the issue, but the cleanup files in trash task did not get stuck. Instead the entire trashdir was deleted.
Does anyone happen to know if this result is to be expected? Would this indicate that the problem is not a specific file or file type?