Creating a Custom Scheduled Task in Moodle to Clean Up Old Log Entries
Learn how to create a Moodle scheduled task that runs periodic PHP code, with a concrete example for cleaning up old log entries, testing via CLI, and verification steps.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Learn how to create a Moodle scheduled task that runs periodic PHP code, with a concrete example for cleaning up old log entries, testing via CLI, and verification steps.
Moodle cron memory growth When running php admin/cli/cron.php on a site, the process RSS steadily rises, even though each scheduled task completes quickly. The feature under scrutiny is Moodle’s cron‑driven task processing, which handles both scheduled tasks (executed on a timetable) and adhoc tasks (queued for asynchronous work). The main uncertainty lies i