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.
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.
Below is an image after selecting the time schedule
4. Enter your command and click on the button “Add New Cron Job”.
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.