How to Create a Cronjob in cPanel

Cron jobs allow you to automate certain commands or scripts on your site. You can set a command or script to run at a specific time every day, week, etc. For example, you could set a cron job to delete temporary files every week to free up disk space.

1. Login to cPanel.

2. Navigate to the Advanced section and click on Cron Jobs icon.

image showing how to create cron jobs in cpanel

3. Select how often you want the cron job to run. For instance, once every five minute, once in a week, once in a month, etc. You can select this from “common settings” or input your own.

image showing how to create cronjobs in cPanel

Below is an image after selecting the time schedule

image showing how to create cronjobs in cPanel

4. Enter your command and click on the button “Add New Cron Job”.

image showing how to create cronjobs in cPanel

PHP command examples:

General example: /usr/local/bin/php /home/example/public_html/path/to/cron/script
Domain-specific example: /usr/local/bin/ea-php56 /home/example/domain_path/path/to/cron/script
In the above example, replace “ea-php56” with the PHP version assigned to the domain you wish to use and “example” with your cpanel username. Look in the MultiPHP Manager for the actual PHP version assigned to a domain.

About the Author
HostPinnacle Kenya
HostPinnacle Kenya is the best and cheapest web hosting company in Kenya with world-class web hosting packages and affordable web design offers. Apart from that we offer free life-time SSL certificate, affordable domain registration in Kenya and free whois privacy. We have an award-winning support team available 24/7/365 to help you with your queries.

Leave a Reply

Call me!