Scheduled tasks.
WHAT CRON IS
The scheduler that runs commands at set times.
WHAT TO USE IT FOR
Scheduled processing Data imports and exports Sending scheduled notifications Cleanup tasks
WHAT TO SPECIFY
The full path to the Python interpreter in your virtual environment The full path to your script
WHY FULL PATHS
Cron runs with a minimal environment and does not know your usual paths.
THE MOST COMMON FAILURE
A script working in the terminal and failing under cron, because of paths or environment.
WHAT ELSE DIFFERS
Environment variables are not inherited.
Set what your script needs explicitly, or load configuration from a file.
WHAT TO DO ABOUT OUTPUT
Redirect it to a log file, so failures are visible.
WHAT HAPPENS OTHERWISE
Output is emailed, or lost.
WHAT TO BUILD INTO ANY SCHEDULED SCRIPT
Logging of start, finish and failure Protection against two copies running at once
WHAT TO TEST
The exact command, run manually, before scheduling it.