How to add a cron job in CPanel ?

How to add a cron job in CPanel ?

How to add a cron job in CPanel ?

Cron jobs are the defined tasks that the systems run on decided time interval. In other words you can these are the predefined task that runs on the system in particular interval of time. You can set up your cron jobs through cpanel for the particular task like get the email notification, specify the command to run on particular time. If you need to run the particular task then you can set a cron jobs in cPanel. Now let’s see how to set cron jobs.......

Add cron job in cpanel :

1. First login to cpanel

2. In “advanced” section click on cron jobs icon.

3. Now set an email cron job through cpanle.
  • To set an email cron you have to enter email address into email text box.
  • Click on “update email
4. Now set the cron jobs time interval through add new cron job.
  • Common settings : click on drop down option and you will find the predefined settings for cron jobs. You can use the predefined common settings, either you can create your own.
  • Minute : select a particular time in minutes to hour in which you want to run your cron job.
  • Hour : select a particular time in hour in which you want to run your cron job.
  • Day : select a particular day in which you want to run your cron job.
  • Month : in this menu select the number of months on which you want to run your cron job.
  • Weekday : select the days of week on which you want to run the cron job.
5. Now its time to enter the desired command in text box :
PHP:
php -q /home/user/public_html /testrun.php
Note : Here user is your username in cPanel.

How to set up the new cron job time?

You will find the cron job time in this order :

[minutes][hour][day][month][weekday][command]

Example : If we adjust time like 50 05 * * * /home/user/public_html/script.php.

Here this cron job will run 5:50AM in the morning. If you are thinking about * then it means everyday or month.

We can describe this as this cron job will run on every fifth hour and 50 minutes of everyday day of every weekday of month. I think now you can set the cron jobs easily in cpanel.
Author
bhawanisingh
Views
1,845
First release
Last update
Rating
0.00 star(s) 0 ratings
Top