How do I create and delete a cron job?

cron jobs run scheduled commands at specific times. This is helpful for setting up automatyed maintenance and other unmanned server duties.

Warning: You need to have a good knowledge of Linux commands before you can use cron jobs effectively. Check your script with your hosting administrator before adding a cron job.For more detailed information on how cron works.

Create a cron Job

To create a cron job in cPanel is quite easy, yet it provides excellent functionality by allowing the execution of scripts at set times.

  1. Login to cPanel.
  2. Go to the "Cron Jobs" option.
  3. Specify the frequency of the cron and enter the command needing to be run.
  4. Click Save.

(Advanced) Custom Environment Variables

If you need to load a custom php.ini to utilise custom environmental values, you may do so by running the command as such:

php -i /home/cpanelusername/public_html /home/cpanelusername/public_html/path/to/file.php

Where the initial /home/cpanelusername/public_html is the directory where your php.ini resides.

Remove or Edit a cron Job

To remove or edit a cron job in cPanel:

  1. Login to cPanel.
  2. Go to the "Cron Jobs" option.
  3. Scroll down to the section called Current Cron Jobs.
  4. Find the cron job you wish to edit or Delete.
  5. Under Actions, for the desired cron job, click either Edit or Delete.

Note: The edit panel has fewer common settings to choose from, so if you are having trouble getting the correct interval, copy the command, delete the cron job and then recreate it using the Add New Cron Job section.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Is it possible to block certain IP's from reaching a website?

Yes it is possible to block certain IP’s from reaching a website; this may include bots or...

Can the PHP configuration be changed?

Yes you can change the configuration of the PHP environment through the use of the PHP Selector...