Forums

Scheduled Tasks not executing the function in a given .py file

Purpose: to run the function, say send_email() in a .py file, say '/usr/home/me/projmail/webapp/automailer.py everyday at 08:00 AM. What I did: https://www.pythonanywhere.com/user/me/tasks_tab/ - used tasks tab and created the schedule by giving the time and file location as "/usr/home/me/projmail/webapp/automailer.py Issue:

  1. The function is not executing.
  2. Is there a way to check whether the given function is to be executed by tasks scheduler or not?

Kindly help out.

That file doesn't exist on PythonAnywhere. Use the actual path to the file you want to run (it's shown at the top of the editor when you're editing the file).

You can see the logs from your scheduled task runs by clicking on the logs button for the task.