WEB HOSTING

How do I create a cron job on cPanel?

A cron job is an automated task executed within an operating system. To perform these tasks, the system regularly runs commands. It can be a simple task, but generally, several complex tasks (i.e., multiple cron jobs) are used. **cPanel & WHM** executes several essential server maintenance scripts this way, and you or your users can also schedule and run scripts on your cPanel hosting.

Create a Cron job in cPanel

Log in to cPanel, scroll down to the Advanced section, and click on the Cron Jobs icon.

Cron Jobs cPanel

Scroll down to the Add New Cron Job section. You can either select from the Common Settings dropdown menus or fill in your own custom values.

Fill out the form as follows:

Common Settings: This option allows you to select a predefined interval for executing your cron job.

If the timing you need is not available in the Common Settings dropdown list, toggle and choose from the Minute, Hour, Day, Month, and Day of the Week settings.

You will notice that each of these entries also has a Common Settings dropdown menu. Choose the appropriate settings.

The last field in the Add New Cron Job section is Command. This is where you enter the file path containing the server command to be executed at the intervals you just specified.

Cron Jobs Settings

A confirmation will appear to verify that the Cron job has been added.

Cron Job

Edit a Cron job

Scroll to the bottom of the page, and under Current Cron Jobs, locate your cron job and click the Edit button.

Current Cron Job

Click the Edit link, which will display the cron job settings. Make the necessary changes and click the Edit line button.

Edit Cron job

Delete a Cron job

Under Current Cron Jobs, locate your cron job and click the Delete button.

Under the “Delete this cron job?” text, click the Delete button.

Delete Cron job

 

Articles Liés