How to setup a cron job in cPanel

A cronjob is program which is enable UNIX users to execute scripts(group of command at specific time period.Its normally used sys admin commands. Cronjob is a very useful tool when you want to run some scripts automatically.

To setup a cronjob follow the steps:

Step 1

Log into your cPanel

Step 2

Click Cron jobs icon under advanced section and follow the below steps.

Step 3

Enter an email address ( the cron output will be sent to this email )

Step 4

Setup the time when the script will be execute.

Step 5

Enter the full path to your script to be executed like

php /home/[username]/public_html/send_mail.php

Note: Please Change [username] with your username and the path of your php script (send_mail.php) in above syntax.
Step 6

Finally Click on the ‘Add New Cron Job‘ button