Moodle cron deleting things

Moodle cron deleting things

by CTPJacó CR -
Number of replies: 4

Hi, I just migrated a Moodle installation from an old server to a new one, and I noticed that the cron job was never executed even on the old installation. So with the intention to make the site better and follow the Moodle installation guidelines, I installed the cron job to run the /admin/cli/cron.php every minute.

The issue is that I started to see thousands of logs about deleted stuff originated by cli. As the screenshot shows, there were course modules, grades, resources and a lot of things, so now I'm affraid those were important things and now students and teachers will be missing grades and activities.

Does anyone know why is this happenning? Is it possible for the cron.php script to delete such important things that easy?

Any help would be appreciated.

Attachment borrado.png
Average of ratings: -
In reply to CTPJacó CR

Re: Moodle cron deleting things

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Deleting content is now done by background tasks. User 2733 is still a real user and they did the delete. It was just actioned in the background by the cron script.

If you're still worried, look up the logs for whoever 2733 is - or even ask them.
Average of ratings: Useful (1)
In reply to Howard Miller

Re: Moodle cron deleting things

by CTPJacó CR -
Well, that explains a lot.

Those where just a bunch of pending deletes because the cron job was never executed, it makes sense.

Thank you very much for your help!!
In reply to CTPJacó CR

Re: Moodle cron deleting things

by Randy Thornton -
Picture of Documentation writers
The specific task Howard refers to is the Recycle bin: https://docs.moodle.org/311/en/Recycle_bin.

Every course ever deleted in your old system will have been sitting there waiting to be finally deleted by this task which runs via cron.

If you really believe some of these courses should not have been deleted to start with, you can pause or stop the Recyle bin by disabling its scheduled task. That would give you a chance to investigate things. But if it is the bin, someone did deliberately delete the course at some time in the past.
Average of ratings: Useful (1)
In reply to Randy Thornton

Re: Moodle cron deleting things

by CTPJacó CR -
I actually let the cron job run and clean everything up. No users complained about deleted stuff so I think that was exactly what happened, they deliberately deleted things but cron wasn't running so all deleted items just stacked up in recycle bin until I first ran the cron job.

Thank you very much!