Execute a File or Web Page Using Cron job at Cpanel | Web Programming Tutorial

Execute a File or Web Page Using Cron job at Cpanel

Published Date: October 13, 2013 |
Published Time: 6:40 pm |

Cron job is a linux os feature. To execute any script we can use cron job. Most of the cpanel has the cron job option. To execute any page or file by a periodic time we can use this cron job feature.

This is usually used, when we need to send email to client at specific day in a month or week, or delete unnecessary file which created for download or upload at specific time or execute any specific task like routine work

Ok, Let’s see how we can do it at Cpanel.

This is a screen shot of a cpanel(partial).
cpanelindex
cpanel

In command first need to write php for excute php file. Then home directory of the hosting displays at left side of cpanel. Then public_htm/ the path where the file located

Example:

php /home6/webprogr/public_html/cron_job/test.php

If we want to execute a web page which has some query with url.then it is better to use curl command if the cpanel has the curl enabled.

Example:

curl http://webprogrammings.net/cron_job/test.php?name=konok

 

Leave a Reply

Your email address will not be published. Required fields are marked *