Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a cronjob for a python script in cpanel?

Tags:

python

cron

I want to run a python script every so often on my web hosting, using cpanel, so it looks like…

However, every single formatting and file path I've tried returns with it saying no such file exists, when in fact I know for sure that it does.

Any help?

If it means anything, I'm running on shared hosting with namecheap.

like image 586
user2602925 Avatar asked Sep 18 '25 01:09

user2602925


1 Answers

Your Python script might be missing permission to execute, or missing shebang on the first line to be interpreted by Python.

Easy solution is to change:

somepath/check_crack.py

into:

python somepath/check_crack.py

or even to:

/usr/bin/python somepath/check_crack.py

This way cron will know, that it shall be interpreted by Python and run it.

like image 113
Jan Vlcinsky Avatar answered Sep 20 '25 16:09

Jan Vlcinsky