How to work cron job in php ?


A cron job allows you to run a certain command at times set by the job. For example, you could set a cron job to delete temporary files every week so that your disk space is not being used up by those files.

To access the Cron Jobs Menu, click on the icon above the words Cron jobs on the main screen of your cPanel interface.

The Cron Jobs Menu in the x2 theme appears as follows:

There are two different modes you can use to add a cron job: Standard and Advanced (UNIX Style)

Standard Cron Jobs Mod

The Standard mode provides a range of pre-set options that you can choose. This is the simplest method and is recommended.

Adding a cron job in standard mode

Step 1: To access the Cron Jobs Menu, click on the icon above the words Cron jobs on the main screen of your cPanel interface.

Step 2: Click on Standard to access the Standard Cron Manager.

Step 3: Enter the email address where the cron output will be sent to in the field:

Step 4: Enter the command you wish the cron job to run in the blank field next to Command to run:

Step 5: Select how often you wish the command to be run by selecting an option in each of the boxes.

Step 6: Click on Save Crontab to save your changes and set up your cron job.

cmd for execute script: php -q /home/jobbd/public_html/script.php


Leave a Reply