A cron job is a command you want to run automatically at specific time intervals on the server. It's used to trigger WordPress plugins, take database backups, make API calls or generate regular reports. cPanel's Cron Jobs tool sets it up in a few clicks; thanks to ready-made time templates (hourly, daily, weekly), you don't need to know the syntax.
1. Opening the Cron Jobs Screen
- Log in to cPanel.
- Type cron in the top search box, or click Cron Jobs in the Advanced section.
- The page has three sections: Cron Email (notification address), Add New Cron Job (adding a new task) and Current Cron Jobs (existing tasks).
2. Setting the Notification Email
Each time a cron runs, the produced output and any errors are sent here by default. Type an active address in the Email field at the top and click Update Email. If left empty, it goes to the cPanel account address.
> /dev/null 2>&1
to the end of the command (shown in examples).
3. Adding a New Cron Job
- Pick one of the ready time templates from the Common Settings menu (e.g. Once Per Hour (0 * * * *), Once Per Day (0 0 * * *)). Your selection auto-fills the five fields below.
- For more custom timing, enter the Minute, Hour, Day, Month, Weekday fields manually.
- Type the command to run in the Command field (examples below).
- Click the Add New Cron Job button.
4. Cron Time Syntax (5 Fields)
Cron timing consists of five fields — left to right: minute, hour, day of month, month,
day of week. An asterisk (*) means "every".
* * * * * command
│ │ │ │ │
│ │ │ │ └── Day of week (0-6, Sunday = 0)
│ │ │ └──── Month (1-12)
│ │ └────── Day of month (1-31)
│ └──────── Hour (0-23)
└────────── Minute (0-59)
Examples:
*/15 * * * *— Every 15 minutes0 * * * *— At the start of every hour (minute 0)0 3 * * *— Every day at 03:000 4 * * 1— Every Monday at 04:000 0 1 * *— At midnight on the 1st of every month
5. Common Command Examples
Run a PHP script:
/usr/local/bin/php /home/username/public_html/cron/task.php
Uses command-line PHP; doesn't go through the web server, so it's faster and not affected by timeouts.
Triggering WordPress wp-cron (recommended for busy sites: disable wp-cron.php with DISABLE_WP_CRON and call it externally):
/usr/local/bin/php /home/username/public_html/wp-cron.php > /dev/null 2>&1
Visit a URL (web request):
/usr/bin/curl -s https://yoursite.com/cron/task.php > /dev/null 2>&1
For tasks that don't have access to command-line PHP or need to run through the web server.
Take a database backup:
mysqldump -u username_dbuser -pPASSWORD username_dbname > /home/username/backups/db-$(date +\%Y\%m\%d).sql
% is a special character in cron syntax; to use it in the date command,
escape it as \%.
6. Editing and Deleting Existing Cron Jobs
From the Current Cron Jobs table at the bottom of the page:
- Edit button — Change the timing or command.
- Delete button — Remove the task entirely (confirmation is requested).
To temporarily disable a job, prepend # to the command to make it a comment
line; however, the cPanel interface doesn't fully support this state, so the cleanest
approach is to delete the job and re-add it later.
If you're having trouble preparing the command for a cron you want to set up, or the job runs but doesn't produce the expected output, you can open a support ticket and share the command; our team will check the logs and help.