Get 10% discount on Hosting Packages + Free Domain & SSL!
Learn More

Knowledge Base

How to Create a Cron Job in Cpanel

How to Create a Cron Job in Cpanel

Cpanel Logo

A Cron Job allows you to automate repetitive tasks such as backups, email dispatch, or data updates at specific intervals. You can easily create and manage cron jobs directly through Cpanel.

1. Log in to Cpanel

Go to https://yourdomain.com:2083 and log in. Then open the “Cron Jobs” section.

2. Email Notifications

If you want to receive email reports when a cron task runs, enter your address in the “Cron Email” field.

3. Add a New Cron Job

In the “Add New Cron Job” section, set your desired schedule:

  • Minute: e.g., 0 = every hour
  • Hour: e.g., 2 = every day at 2 AM
  • Day: e.g., * = every day
  • Month: e.g., * = every month
  • Weekday: e.g., * = every day of the week

Then enter the command to run (example):

php -q /home/username/public_html/cron/backup.php

4. Save the Cron Job

Click “Add New Cron Job” to save your task. The newly created cron job will appear in the list below.

5. Testing and Logs

To verify the cron job, check after the scheduled time to confirm the script has executed. View the cron log in the /tmp directory for error messages if necessary.

Note: Ensure your file paths and permissions are correct. Incorrect settings may cause cron jobs to fail.

Can't find the information you are looking for?

Create a Support Ticket
Did you find it useful?

1 times viewed | 0 people fount it helpful

08503078812 908503078812