Setting up Cronjob

Set up cron job in cPanel

Here are 2 popular methods of running a cron job via cPanel.

For example:

0 0 * * * php -q /home/youraccountusername/public_html/pathtoyourfile.php

0 0 * * * wget -q -O/dev/null http://www.websiteurl.com.sg/pathtoyourfile.php

 

Step 1. Login to the cPanel.

cPanel-Login-SS

Step 2. Click on Cron Jobs under the Advanced panel.

cronjob1

Step 3. To set up a cron job:

Common Settings – commonly used time and date interval. The cPanel will give suggestions on what cron job you may want to use.

cronjob3

Minute –  This drop-down menu allows you to select the number of minutes between running the cron job, or the minute each hour on which you wish to run the cron job.
Hour – This drop-down menu allows you to select the number of hours between running the cron job, or the hour each day on which you wish to run the cron job.
Day – This drop-down menu allows you to select the number of days between running the cron job, or the day of the month on which you wish to run the cron job.
Month – This drop-down menu allows you to select the number of months between running the cron job, or the month of the year in which you wish to run the cron job.
Weekday – This drop-down menu allows you to select the day(s) of the week on which you wish to run the cron job.

cronjob2

Note: If you do not wish to receive an email notification of a specific cron job, add the following
line to the command: >/dev/null 2>&1

Step 4. Click Add New Cron Job button to save the changes.cronjob4

Last Updated On May 09, 2018