Helpdesk
14.04.2025 16:20 46 Displayed

How to Add Cron Jobs in cPanel?

In this article, we will explain step-by-step how to add Cron Jobs in cPanel.

First, let’s define what Cron Jobs are.

Cron Jobs are an automation tool in cPanel. They allow you to automate commands that will run at specific intervals on your website. This can include tasks such as backing up your website or checking for updates. For example, if you want to back up a file every six hours, you can do this using cPanel's Cron Jobs feature.

To Create a Cron Job in cPanel:

1- Log in to the Customer Control Panel:

Log in to your Atak Domain customer control panel.

How to Add Cron Jobs in cPanel?

2- Select Your Hosting Account:

Click the "My Hostings" button in the Atak Domain Customer Control Panel.

How to Add Cron Jobs in cPanel?

  • Click the Manage button next to your hosting service.

How to Add Cron Jobs in cPanel?

3- Access cPanel:

On the "Hosting Management" page, click the Go to Control Panel button to access cPanel.

How to Add Cron Jobs in cPanel?

4- Click on Cron Jobs:

Under the Advanced section, click on the Cron Jobs icon.

How to Add Cron Jobs in cPanel?

5- Set Email for Notifications:

You can enter an email address to receive notifications when your Cron jobs run. (In this example, the address used is [email protected])

How to Add Cron Jobs in cPanel?

6- Add a Cron Job:

You can simplify the setup by selecting a frequency from the Common Settings dropdown. It offers predefined schedules for running jobs (every minute, hourly, monthly, etc.).

  • If the timing you need isn’t available in the "Common Settings" dropdown, you can manually define it using the "Minute", "Hour", "Day", "Month", and "Weekday" fields.

Common Settings: Offers commonly used intervals. Selecting one will automatically populate the minute, hour, day, month, and weekday fields.

Minute: Minute setting for the cron job

Hour: Hour setting for the cron job

Day: Day setting for the cron job

Month: Month setting for the cron job

Weekday: Weekday setting for the cron job

Command: The command to be executed by the cron job

  • The example below shows a cron job set to run on the 1st and 15th of each month.

How to Add Cron Jobs in cPanel?

  • When defining a Cron job, you must specify the full path to the files. Let’s run a PHP file as an example:

1- Let's say you want to fetch the USD exchange rate from the Central Bank. You have a file named kur_guncelle.php uploaded under public_html.

File Path:
/home/username/public_html/kur_guncelle.php

2- Prepare the command to enter in the “Command” field.

Common Settings:
Runs every day at midnight (00:00).

Your Command:
/usr/local/bin/php /home/username/public_html/kur_guncelle.php

Note: Replace username with your actual cPanel username. (In the example, it was acc368atakdomai.)

How to Add Cron Jobs in cPanel?

Click the Add New Cron Job button to save the job.

How to Add Cron Jobs in cPanel?

Congratulations! Your cron job has been added. In this section, you can create, edit, or delete Cron jobs.

How to Add Cron Jobs in cPanel?

How to Add Cron Jobs in cPanel?