My python script is not running under my crontab.
I have placed this in the python script at the top:
#!/usr/bin/python
I hav
It's usually because the python used by crontab is different from the one you use in the shell. The easiest way to solve this is:
$ which python # it may be "python3" or something else
/usr/bin/python
* * * * * /usr/bin/python test.py
Also want to mention that using env -i /bin/bash --noprofile --norc
in the shell lets you have the same environment as the one used by crontab, and this is super helpful to debug.
Try this
* * * * * cd <directory_where_python_file_is> && bin/app etc/app_defaults.yaml
There is some path issue with cron. So when you move to directory with python file, cron works like charm!
I'd got the same problem. Despite the fact that the script executed manually was working, in crontab no options mentioned above were working at all. I've moved my script from /home/user/script_directory/ to /opt/scripts/ and it started to work. Possible cause of the problem should be the access (read) permissions to subfolder located in home directory.