Setting up a cron job with Cpanel

Cron job make can our life easier. If you have a daily task to do, create a cron job with your cpanel.

1. Login to your cpanel.

2. Click on cron job.

3. Pick standard.

4. Enter the minutes, hour, or days your job to be executed. Fairly easy there.

5. Enter this line (example): php -q /home/path-to-cron-file/sample.php
This example is assuming that you have written your php code in sample.php.

To just open a webpage from cron:

wget -N http://example.com/...stalldir/wp-mail.php
Posted February 17th, 2006 by mightyhitter under PHP

 

One Response to “Setting up a cron job with Cpanel”

  1. Geoff Merritt Says:

    php -q /home/path-to-cron-file/sample.php

    This took a little trial and error to work out, in my situation I replaced the “home” with “public_html” which is the root directory where I upload the website to.

Leave a Reply