How to configure a cron job on Open edX (Ulmo / Tutor v21)?

Hi everyone,

We’re running Open edX Ulmo on Tutor v21 deployed on AWS EC2. As part of a customization, we’ve built a Django management command that sends scheduled notifications to users, and we need to run it every 15 minutes via cron:

*/15 * * * * python manage.py lms run_scheduled_notifications

I’m not sure about the right approach to configure this in a Tutor-based setup — since everything runs inside Docker containers, a simple host-level crontab entry doesn’t feel like the correct way to do it.

A few questions I have:

  1. Should this be configured as a host-level cron that runs tutor local exec lms ..., or is there a Tutor-native way to handle this?
  2. Is there an existing Tutor plugin hook or pattern for registering periodic tasks?
  3. Are there any pitfalls to watch out for — for example, environment variables, the correct Python path inside the container, or Django settings?

Any pointers to official documentation or community examples would be really helpful.

Thanks in advance!

In my setup, Tutor is installed inside a Python virtual environment, so I can’t run tutor commands directly from cron unless the virtual environment is activated first.

To keep things simple, I use docker exec to run the management command directly inside the LMS container:

*/15 * * * * docker exec tutor_local-lms-1 /bin/sh -c "python manage.py lms run_scheduled_notifications"

This allows the command to run within the LMS container using the existing Open edX environment, without needing to activate the virtual environment on the host.

Let me know if that works for your setup.