How to Set Up A Cron Job In cPanel

A cron job in Linux (or other operating systems) allows us to schedule tasks. It ensures that a job starts at a specific time and runs as planned. Every cron job also logs its execution, so we can track:. You might, for example, configure a custom backup script to run at 7 a.m. each morning.



Common Uses

Cron jobs are widely used to streamline workflows and reduce manual operations. Examples include:



1. Generating sitemaps or executing background API syncing

2. Sending periodic newsletter or notification emails

3. Offloading resource-heavy background processes from web traffic triggers (e.g., configuring scheduled posts in CMS platforms like WordPress)

4. Clearing website cache and temporary files

5. Automatically backing up databases or files



Steps to Set Up a Cron Job

You can manage scheduled tasks directly through the visual interface rather than dealing with the command line.



1. Navigate: Log in to your cPanel dashboard, scroll to the Advanced section, and click on Cron Jobs.

2. Setup Notifications (Optional): Enter an email address under Cron Email if you want to receive alerts with the job’s execution output every time the task runs.

3. Define the Schedule: Under Add New Cron Job, either choose a pre-defined interval from the Common Settings dropdown (e.g., “Once Per Day” or “Once Per Hour”), or manually fill in the Minute, Hour, Day, Month, and Weekday fields.

4. Enter the Command: Type the specific command or path to the script you want executed in the Command field.

5. Save: Click Add New Cron Job.

Watch the video below for a guide on how to configure a Cron Job in your cPanel: