What is Cron job
A cron job is a process to run a page automatically on server. After setting up a cron job we do not need to run it on daily basis. We can execute a page automatically at any time on daily basis by setting a up a cron job.Here I am going to explain the step wise step process of setting up a corn job in cpanel of godaddy server. So If you want to execute a page on daily basis at a particular time, follow below process of setting up cron job.
Step-1:
To setup a cron job First login to your godaddy account then open your cpanel. now go to
Cpanel -> Section Advances -> Cron jobs menu.
Step-2:
Add Cron e-mail if you want to notify by email when your cron job run.
If you do not want to notify by email every time for an individual cron job you can redirect the command’s output to /dev/null like this:
mycommand >/dev/null 2>&1
Step-3:
Now add new cron job
Command:
if you do not want to notify by email then command will be:-
/usr/local/bin/php -q /home/YOUEcPuser/public_html/php_yourScript.php
/usr/local/bin/php -q /home/YOUEcPuser/public_html/php_yourScript.php
>/dev/null 2>&1
if you want to use relative path then different commands are divided by ";"
Python & Perls command:
for python and perls the correct command will be:-
Perls:-
python/home/yourCPuser/public_html/yourScript.py
perls/home/yourCPuser/public_html/yourScript.pl
- There is no need to use full path to environment, environment interpreter directive will be enough on shared servers.
Note: Only a member of this blog may post a comment.