Introduction
With the following procedure, you can manage cron jobs directly in the cPanel interface.
Procedure
Creating a cron job involves the following steps:
- Login to the cPanel account
- Click on the "Cron Jobs" icon, which is under the Advanced section (Ask your hosting provider to enable this feature if it is missing)
- Under the "Common Settings" header, you can select a commonly used rate at which your cronjob will run, such as "Once per 5 minutes". This will automatically configure the cronjob time setting for you. If you would like to select the time period manually, you are welcome to do so.
- Under the "Command" header, enter the command that you would like to be run. Below are some examples:
To execute a bash script that you've written, enter the following in the command text box:
bash /home/cpanelusername/full/path/to/your/bash/script.sh
For a Perl script, you would use:
perl /home/cpanelusername/full/path/to/your/perl/script.pl
Python
python /home/cpanelusername/full/path/to/your/python/script.py
PHP
/usr/local/bin/php /home/cpanelusername/full/path/to/your/php/script.php
If a specific PHP version is needed, the path to the ea-php version needs to be used:
/usr/local/bin/ea-phpXX /home/cpanelusername/full/path/to/your/php/script.php
Replacing XX with your desired PHP version. For example, with PHP 8.2:
/usr/local/bin/ea-php82
After a cron job is added, you can edit and delete the cron under the "Current Cron Jobs" section.
Comments
0 comments
Article is closed for comments.