Why Does A Python Script Work From The Cli, But Not When Called From A Cron Job?
I have created a Python script that I want to run daily via a cronjob on an Ubuntu server. This is how this script would be run from the Command Line: python /home/username/public
Solution 1:
The crontab probably cannot find the python executable although it can on the CLI, so you need to write down the complete path to python. The same you get from
which python
Crontab supplies an environment for the scripts, which is not the same as the normal user environment.
Post a Comment for "Why Does A Python Script Work From The Cli, But Not When Called From A Cron Job?"