General cron job format is as follows:
[path to environment] [Path to script] [Script parameters]
For example, if you want to run a
PHP script located in the public_html directory, the correct cron command will be:
/usr/local/bin/php /home/cPaneluser/public_html/yourscript.php
or if you want to use a relative path (different commands are divided by “;”):
cd /home/YourcPuser/public_html/; /usr/local/bin/php yourscript.php
For
Python and
Perl scripts, there is no need to use a full path to the environment, the environment interpreter directive will be enough on shared servers.
python /home/YourcPuser/public_html/yourscript.py
perl /home/YourcPuser/public_html/yourscript.pl
Alternatively, you can just use
curl request as the cron job command for the same purpose:
curl “http://yourdomain.com/script.php?arg...ument2=arg2”
curl “http://yourdomain.com/script.py”
curl “http://yourdomain.com/script.pl”
However, unlike the first method, curl-based cron jobs will work only if URLs specified in curl requests are resolving, e.g., DNS records for the domain are correct and running.